Skip to content

Commit a350dc3

Browse files
committed
Remove "::" from SYMEX_DYNAMIC_PREFIX
This is to prepare use in combination with get_fresh_aux_symbol.
1 parent 24295fa commit a350dc3

File tree

7 files changed

+12
-9
lines changed

7 files changed

+12
-9
lines changed

src/ansi-c/expr2c.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1617,7 +1617,7 @@ std::string expr2ct::convert_symbol(
16171617
dest=id2string(entry->second);
16181618

16191619
#if 0
1620-
if(has_prefix(id2string(id), SYMEX_DYNAMIC_PREFIX "dynamic_object"))
1620+
if(has_prefix(id2string(id), SYMEX_DYNAMIC_PREFIX "::dynamic_object"))
16211621
{
16221622
if(sizeof_nesting++ == 0)
16231623
dest+=" /*"+convert(src.type());

src/goto-instrument/race_check.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ static bool is_shared(const namespacet &ns, const symbol_exprt &symbol_expr)
130130
identifier == "stdout" || identifier == "stderr" ||
131131
identifier == "sys_nerr" ||
132132
has_prefix(id2string(identifier), "symex::invalid_object") ||
133-
has_prefix(id2string(identifier), SYMEX_DYNAMIC_PREFIX "dynamic_object"))
133+
has_prefix(id2string(identifier), SYMEX_DYNAMIC_PREFIX "::dynamic_object"))
134134
return false; // no race check
135135

136136
const symbolt &symbol=ns.lookup(identifier);

src/goto-symex/goto_symex_state.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,8 @@ void goto_symex_statet::assignment(
202202
|| l1_identifier == guard_identifier()
203203
|| ns.lookup(l1_identifier).is_shared()
204204
|| has_prefix(id2string(l1_identifier), "symex::invalid_object")
205-
|| has_prefix(id2string(l1_identifier), SYMEX_DYNAMIC_PREFIX "dynamic_object"));
205+
|| has_prefix(id2string(l1_identifier),
206+
SYMEX_DYNAMIC_PREFIX "::dynamic_object"));
206207
#endif
207208

208209
// do the l2 renaming

src/goto-symex/symex_builtin_functions.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ void goto_symext::symex_allocate(
137137
size_symbol.base_name=
138138
"dynamic_object_size"+std::to_string(dynamic_counter);
139139
size_symbol.name =
140-
SYMEX_DYNAMIC_PREFIX + id2string(size_symbol.base_name);
140+
SYMEX_DYNAMIC_PREFIX "::" + id2string(size_symbol.base_name);
141141
size_symbol.type=tmp_size.type();
142142
size_symbol.mode = mode;
143143
size_symbol.type.set(ID_C_constant, true);
@@ -156,7 +156,8 @@ void goto_symext::symex_allocate(
156156
symbolt value_symbol;
157157

158158
value_symbol.base_name="dynamic_object"+std::to_string(dynamic_counter);
159-
value_symbol.name = SYMEX_DYNAMIC_PREFIX + id2string(value_symbol.base_name);
159+
value_symbol.name =
160+
SYMEX_DYNAMIC_PREFIX "::" + id2string(value_symbol.base_name);
160161
value_symbol.is_lvalue=true;
161162
value_symbol.type = *object_type;
162163
value_symbol.type.set(ID_C_dynamic, true);
@@ -401,7 +402,7 @@ void goto_symext::symex_cpp_new(
401402
symbol.base_name=
402403
do_array?"dynamic_"+count_string+"_array":
403404
"dynamic_"+count_string+"_value";
404-
symbol.name = SYMEX_DYNAMIC_PREFIX + id2string(symbol.base_name);
405+
symbol.name = SYMEX_DYNAMIC_PREFIX "::" + id2string(symbol.base_name);
405406
symbol.is_lvalue=true;
406407
if(code.get(ID_statement)==ID_cpp_new_array ||
407408
code.get(ID_statement)==ID_cpp_new)

src/solvers/flattening/pointer_logic.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ bool pointer_logict::is_dynamic_object(const exprt &expr) const
2727
(expr.id() == ID_symbol &&
2828
has_prefix(
2929
id2string(to_symbol_expr(expr).get_identifier()),
30-
SYMEX_DYNAMIC_PREFIX));
30+
SYMEX_DYNAMIC_PREFIX "::"));
3131
}
3232

3333
void pointer_logict::get_dynamic_objects(std::vector<std::size_t> &o) const

src/util/pointer_predicates.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Author: Daniel Kroening, [email protected]
1212
#ifndef CPROVER_UTIL_POINTER_PREDICATES_H
1313
#define CPROVER_UTIL_POINTER_PREDICATES_H
1414

15-
#define SYMEX_DYNAMIC_PREFIX "symex_dynamic::"
15+
#define SYMEX_DYNAMIC_PREFIX "symex_dynamic"
1616

1717
class exprt;
1818
class namespacet;

src/util/simplify_expr_pointer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,8 @@ bool simplify_exprt::simplify_dynamic_object(exprt &expr)
553553
const irep_idt identifier=to_symbol_expr(op.op0()).get_identifier();
554554

555555
// this is for the benefit of symex
556-
expr.make_bool(has_prefix(id2string(identifier), SYMEX_DYNAMIC_PREFIX));
556+
expr.make_bool(
557+
has_prefix(id2string(identifier), SYMEX_DYNAMIC_PREFIX "::"));
557558
return false;
558559
}
559560
else if(op.op0().id()==ID_string_constant)

0 commit comments

Comments
 (0)