File tree 2 files changed +19
-2
lines changed
regression/ansi-c/sizeof4 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 1
- KNOWNBUG
1
+ CORE
2
2
main.c
3
3
4
4
^EXIT=0$
Original file line number Diff line number Diff line change @@ -931,7 +931,24 @@ void c_typecheck_baset::typecheck_expr_sizeof(exprt &expr)
931
931
}
932
932
else
933
933
{
934
- type.swap (to_unary_expr (expr).op ().type ());
934
+ const exprt &op = to_unary_expr (as_const (expr)).op ();
935
+ // This is one of the few places where it's detectable
936
+ // that we are using "bool" for boolean operators instead
937
+ // of "int". We convert for this reason.
938
+ if (op.type ().id () == ID_bool && (
939
+ op.id () == ID_not ||
940
+ op.id ()==ID_equal ||
941
+ op.id ()==ID_notequal ||
942
+ op.id ()==ID_lt ||
943
+ op.id ()==ID_le ||
944
+ op.id ()==ID_gt ||
945
+ op.id ()==ID_ge ||
946
+ op.id () == ID_if))
947
+ {
948
+ type = signed_int_type ();
949
+ }
950
+ else
951
+ type = op.type ();
935
952
}
936
953
937
954
exprt new_expr;
You can’t perform that action at this time.
0 commit comments