Skip to content

Commit 210b0ea

Browse files
committed
Disable support for constant(zero) as NULL
All front-ends and any other code should take care of generating constant(NULL) instead.
1 parent 2992eaf commit 210b0ea

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/util/expr_util.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,5 +320,14 @@ bool is_null_pointer(const constant_exprt &expr)
320320
if(expr.get_value() == ID_NULL)
321321
return true;
322322

323+
// We used to support "0" (when NULL_is_zero), but really front-ends should
324+
// resolve this and generate ID_NULL instead.
325+
#if 0
323326
return config.ansi_c.NULL_is_zero && expr.value_is_zero_string();
327+
#else
328+
INVARIANT(
329+
!expr.value_is_zero_string() || !config.ansi_c.NULL_is_zero,
330+
"front-end should use ID_NULL");
331+
return false;
332+
#endif
324333
}

0 commit comments

Comments
 (0)