Skip to content

Commit 1ab1e67

Browse files
committed
Cumulative fixup
1 parent b01d521 commit 1ab1e67

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

src/goto-harness/memory_snapshot_harness_generator.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,12 @@ void memory_snapshot_harness_generatort::handle_option(
103103
}
104104
else if(option == MEMORY_SNAPSHOT_HARNESS_HAVOC_VARIABLES_OPT)
105105
{
106-
variables_to_havoc.insert(values.begin(), values.end());
106+
std::vector<std::string> havoc_candidates;
107+
split_string(values.front(), ',', havoc_candidates, true);
108+
for(const auto &candidate : havoc_candidates)
109+
{
110+
variables_to_havoc.insert(candidate);
111+
}
107112
}
108113
else
109114
{

src/memory-analyzer/analyze_symbol.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ exprt symbol_analyzert::get_char_pointer_value(
190190
}
191191
else
192192
{
193-
return it->second;
193+
return symbol_exprt{to_symbol_expr(it->second).get_identifier(),
194+
expr.type().subtype()};
194195
}
195196
}
196197

@@ -315,7 +316,14 @@ exprt symbol_analyzert::get_pointer_value(
315316
{
316317
if(is_c_char(expr.type().subtype()))
317318
{
318-
return get_char_pointer_value(expr, memory_location, location);
319+
INVARIANT(
320+
!points_to_member(value),
321+
"pointers-to-char shouldn't point to members");
322+
const auto result_pointee_expr =
323+
get_char_pointer_value(expr, memory_location, location);
324+
const auto result_expr = address_of_exprt{result_pointee_expr};
325+
CHECK_RETURN(result_expr.type() == zero_expr.type());
326+
return result_expr;
319327
}
320328
else
321329
{

0 commit comments

Comments
 (0)