Skip to content

Commit b6fcb94

Browse files
committed
Do not shadow size variable
The requested allocation size is different from the specific reference into the array, which is later on used to replace the array size. Different names will help avoid any confusion.
1 parent 1117cac commit b6fcb94

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/goto-symex/symex_builtin_functions.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ void goto_symext::symex_allocate(
127127
if(object_type.id()==ID_array &&
128128
!to_array_type(object_type).size().is_constant())
129129
{
130-
exprt &size=to_array_type(object_type).size();
130+
exprt &array_size = to_array_type(object_type).size();
131131

132132
auxiliary_symbolt size_symbol;
133133

@@ -137,12 +137,12 @@ void goto_symext::symex_allocate(
137137
size_symbol.type=tmp_size.type();
138138
size_symbol.mode = mode;
139139
size_symbol.type.set(ID_C_constant, true);
140-
size_symbol.value = size;
140+
size_symbol.value = array_size;
141141

142142
state.symbol_table.add(size_symbol);
143143

144-
code_assignt assignment(size_symbol.symbol_expr(), size);
145-
size=assignment.lhs();
144+
code_assignt assignment(size_symbol.symbol_expr(), array_size);
145+
array_size = assignment.lhs();
146146

147147
symex_assign(state, assignment);
148148
}

0 commit comments

Comments
 (0)