We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 00cc4b1 + 8d8c2e0 commit 1a88479Copy full SHA for 1a88479
src/ansi-c/c_typecheck_expr.cpp
@@ -1244,7 +1244,10 @@ void c_typecheck_baset::typecheck_expr_index(exprt &expr)
1244
1245
make_index_type(index_expr);
1246
1247
- const typet &final_array_type=follow(array_expr.type());
+ // array_expr is a reference to one of expr.operands(), when that vector is
1248
+ // swapped below the reference is no longer valid. final_array_type exists
1249
+ // beyond that point so can't be a reference
1250
+ const typet final_array_type = follow(array_expr.type());
1251
1252
if(final_array_type.id()==ID_array ||
1253
final_array_type.id()==ID_vector)
0 commit comments