File tree 2 files changed +19
-2
lines changed
regression/cbmc-java/NullPointer3
2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 1
- KNOWNBUG
1
+ CORE
2
2
NullPointer3.class
3
3
--pointer-check
4
4
^EXIT=10$
Original file line number Diff line number Diff line change @@ -919,7 +919,6 @@ void goto_checkt::pointer_validity_check(
919
919
if (flags.is_unknown () || flags.is_null ())
920
920
{
921
921
notequal_exprt not_eq_null (pointer, gen_zero (pointer.type ()));
922
- // exprt not_eq_null=not_exprt(null_pointer(pointer));
923
922
924
923
add_guarded_claim (
925
924
not_eq_null,
@@ -1537,6 +1536,24 @@ void goto_checkt::goto_check(goto_functiont &goto_function)
1537
1536
}
1538
1537
else if (i.is_throw ())
1539
1538
{
1539
+ if (i.code .get_statement ()==ID_expression &&
1540
+ i.code .operands ().size ()==1 &&
1541
+ i.code .op0 ().operands ().size ()==1 )
1542
+ {
1543
+ // must not throw NULL
1544
+
1545
+ exprt pointer=i.code .op0 ().op0 ();
1546
+ notequal_exprt not_eq_null (pointer, gen_zero (pointer.type ()));
1547
+
1548
+ add_guarded_claim (
1549
+ not_eq_null,
1550
+ " throwing null" ,
1551
+ " pointer dereference" ,
1552
+ i.source_location ,
1553
+ pointer,
1554
+ guardt ());
1555
+ }
1556
+
1540
1557
// this has no successor
1541
1558
assertions.clear ();
1542
1559
}
You can’t perform that action at this time.
0 commit comments