Skip to content

Commit 5eb8a94

Browse files
committed
Goto analyzer: do not create untyped nil expression
We need to create a typed variant of top rather than relying on eval to produce a typed expression. Tests involving pointer difference spuriously passed for 64-bit platforms include a type cast in those expressions. The abstract evaluation of said type cast resulted in typed expressions despite the untyped nil input.
1 parent 28e4238 commit 5eb8a94

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/analyses/variable-sensitivity/abstract_pointer_object.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ abstract_object_pointert abstract_pointer_objectt::eval_ptr_diff(
9999
const namespacet &ns) const
100100
{
101101
if(is_top() || operands[1]->is_top())
102-
return environment.eval(nil_exprt(), ns);
102+
return environment.abstract_object_factory(expr.type(), ns, true, false);
103103

104104
return ptr_diff(expr, operands, environment, ns);
105105
}

0 commit comments

Comments
 (0)