shithub: scc

Download patch

ref: 5abe139e4bd964efe5f93105a8deebb03594f790
parent: a590d782a37a2bea19608f5cb599de8b123daf7d
author: Roberto E. Vargas Caballero <[email protected]>
date: Tue Feb 21 12:08:45 EST 2017

[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

--- /dev/null
+++ b/tests/execute/0115-null-comparision.c
@@ -1,0 +1,5 @@
+int
+main()
+{
+	return "abc" == (void *)0;
+}