Skip to content

Commit 945a02b

Browse files
Petr BauchPetr Bauch
Petr Bauch
authored and
Petr Bauch
committed
Add and check type of pointees in memory analyzer
GDB does not know (the CBMC) types but the resulting symbol table requires them.
1 parent 348028f commit 945a02b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/memory-analyzer/analyze_symbol.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,9 @@ exprt symbol_analyzert::get_non_char_pointer_value(
272272
}
273273
else
274274
{
275-
return it->second;
275+
const symbol_exprt typed_symbol_value = symbol_exprt{
276+
to_symbol_expr(it->second).get_identifier(), expr.type().subtype()};
277+
return typed_symbol_value;
276278
}
277279
}
278280

@@ -328,7 +330,9 @@ exprt symbol_analyzert::get_pointer_value(
328330
}
329331
else
330332
{
331-
return address_of_exprt(target_expr);
333+
const auto result_expr = address_of_exprt(target_expr);
334+
CHECK_RETURN(result_expr.type() == zero_expr.type());
335+
return result_expr;
332336
}
333337
}
334338
}

0 commit comments

Comments
 (0)