Skip to content

Commit 1a88479

Browse files
authored
Merge pull request #1896 from NathanJPhillips/bugfix/erroneous-reference
Fix bug causing crash on Windows
2 parents 00cc4b1 + 8d8c2e0 commit 1a88479

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: src/ansi-c/c_typecheck_expr.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -1244,7 +1244,10 @@ void c_typecheck_baset::typecheck_expr_index(exprt &expr)
12441244

12451245
make_index_type(index_expr);
12461246

1247-
const typet &final_array_type=follow(array_expr.type());
1247+
// 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());
12481251

12491252
if(final_array_type.id()==ID_array ||
12501253
final_array_type.id()==ID_vector)

0 commit comments

Comments
 (0)