Skip to content

Commit bb9714a

Browse files
committed
CHB:ARM: rewrite test expression in jump context
1 parent 5ecdffd commit bb9714a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

CodeHawk/CHB/bchlibarm32/bCHFnARMDictionary.ml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,8 +1128,10 @@ object (self)
11281128
let txpr = floc#get_test_expr in
11291129
let fxpr = simplify_xpr (XOp (XLNot, [txpr])) in
11301130
let csetter = floc#f#get_associated_cc_setter floc#cia in
1131-
let tcond = rewrite_test_expr csetter txpr in
1132-
let fcond = rewrite_test_expr csetter fxpr in
1131+
(* we can rewrite with invariants at this address, since the expression
1132+
should have been made position independent for local variables.*)
1133+
let tcond = rewrite_expr txpr in
1134+
let fcond = rewrite_expr fxpr in
11331135
let ctcond_r = floc#convert_xpr_to_c_expr ~size:(Some 4) tcond in
11341136
let cfcond_r = floc#convert_xpr_to_c_expr ~size:(Some 4) fcond in
11351137
let csetter_addr_r = string_to_doubleword csetter in
@@ -2193,6 +2195,7 @@ object (self)
21932195
let vrd_r = rd#to_variable floc in
21942196
let xrm_r = rm#to_expr floc in
21952197
let result_r = TR.tmap (rewrite_expr ?restrict:(Some 4)) xrm_r in
2198+
let result_r = TR.tmap (rewrite_in_cc_context floc c) result_r in
21962199
let cresult_r =
21972200
TR.tbind (floc#convert_xpr_to_c_expr ~size:(Some 4)) result_r in
21982201
let rdefs = (get_rdef_r xrm_r) :: (get_all_rdefs_r result_r) in

0 commit comments

Comments
 (0)