Skip to content

Commit 19e51b0

Browse files
author
martin
committed
Fix a crashing bug with type comparison.
1 parent 8960b8a commit 19e51b0

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
struct st {
2+
int a;
3+
int b;
4+
};
5+
6+
struct st sts_inf;
7+
8+
void func( struct st* inf); // no body
9+
10+
void main(void)
11+
{
12+
func(&sts_inf); // assertion failed here
13+
}
14+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
CORE
2+
main.c
3+
--variable-sensitivity --structs --arrays --pointers --show
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
--

src/analyses/variable-sensitivity/constant_pointer_abstract_object.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ sharing_ptrt<pointer_abstract_objectt>
328328
if(stack.empty())
329329
{
330330
// We should not be changing the type of an abstract object
331-
PRECONDITION(new_value->type()==type().subtype());
331+
PRECONDITION(new_value->type()==ns.follow(type().subtype()));
332332

333333
// Get an expression that we can assign to
334334
exprt value=value_stack.to_expression().op0();

0 commit comments

Comments
 (0)