Skip to content

Commit 8e2ee91

Browse files
committed
Pointer dereferencing of integers is invalid
This may arise through typecast variables.
1 parent 98bce91 commit 8e2ee91

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/pointer-analysis/dereference.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,10 @@ exprt dereferencet::dereference_plus(
513513
std::swap(pointer, integer);
514514
}
515515
else if(!has_pointer(pointer, ns))
516-
throw "missing pointer in pointer arithmetic";
516+
{
517+
invalid_cond.make_true();
518+
return nil_exprt();
519+
}
517520

518521
exprt size=size_of_expr(char_type(), ns);
519522
assert(size.is_not_nil());

0 commit comments

Comments
 (0)