[hackers] [scc] [cc1] Fix pcompare() with NULL operands || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Wed, 22 Feb 2017 07:32:38 +0100 (CET)

commit 78ca1ab63db47617702ebe635122fa8907fc95de
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Tue Feb 21 17:08:45 2017 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Wed Feb 22 07:32:32 2017 +0100

    [cc1] Fix pcompare() with NULL operands
    
    Pcompare() was using eqtype() to see if the type of the operands
    were compatible, but this is an error because a null pointer
    can be compared to any pointer. For this reason the correct
    code must use convert() which currently deals with all the
    possible combinations

diff --git a/tests/execute/0115-null-comparision.c b/tests/execute/0115-null-comparision.c
new file mode 100644
index 0000000..7f1084e
--- /dev/null
+++ b/tests/execute/0115-null-comparision.c
_AT_@ -0,0 +1,5 @@
+int
+main()
+{
+ return "abc" == (void *)0;
+}
Received on Wed Feb 22 2017 - 07:32:38 CET

This archive was generated by hypermail 2.3.0 : Wed Feb 22 2017 - 07:36:17 CET