Skip to content

Commit 9f021d1

Browse files
authored
Merge pull request #5076 from diffblue/opX-ansi-c
Fix accesses to exprt::opX() in ansi-c/
2 parents 59730ab + 3c117db commit 9f021d1

File tree

3 files changed

+119
-119
lines changed

3 files changed

+119
-119
lines changed

src/ansi-c/c_typecheck_expr.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2672,10 +2672,11 @@ exprt c_typecheck_baset::do_special_functions(
26722672
if(
26732673
tmp1.id() == ID_typecast &&
26742674
to_typecast_expr(tmp1).op().id() == ID_address_of &&
2675-
to_typecast_expr(tmp1).op().operands().size() == 1 &&
2676-
to_typecast_expr(tmp1).op().op0().id() == ID_index &&
2677-
to_typecast_expr(tmp1).op().op0().operands().size() == 2 &&
2678-
to_typecast_expr(tmp1).op().op0().op0().id() == ID_string_constant)
2675+
to_address_of_expr(to_typecast_expr(tmp1).op()).object().id() ==
2676+
ID_index &&
2677+
to_index_expr(to_address_of_expr(to_typecast_expr(tmp1).op()).object())
2678+
.array()
2679+
.id() == ID_string_constant)
26792680
{
26802681
is_constant=true;
26812682
}

0 commit comments

Comments
 (0)