@@ -153,9 +153,9 @@ object (self)
153153 offset > = self#offset && offset < self#offset + size
154154
155155 method frame2object_offset_value (xpr : xpr_t ): xpr_t traceresult =
156- let (t, _coffset) = BCHXprUtil. smallest_wrapped_constant_term xpr in
157- let xoff = simplify_xpr (XOp (XMinus , [xpr; num_constant_expr t ])) in
158- Ok xoff
156+ let xoff =
157+ simplify_xpr (XOp (XMinus , [xpr; int_constant_expr self#offset ])) in
158+ Ok xoff
159159
160160 method frame_offset_memory_offset
161161 ?(tgtsize =None )
@@ -584,10 +584,26 @@ object (self)
584584 ()
585585 else
586586 let restore = RegisterRestore (offset, reg) in
587+ let mk_stackslot () =
588+ let ssrec = {
589+ sslot_name = (register_to_string reg) ^ " _spill" ;
590+ sslot_offset = offset;
591+ sslot_btype = t_unknown;
592+ sslot_spill = Some reg;
593+ sslot_size = Some 4 ;
594+ sslot_loopcounter = false ;
595+ sslot_desc = Some " register restore"
596+ } in
597+ new stackslot_t ssrec in
587598 begin
588599 (if H. mem stackslots offset then
589600 if (H. find stackslots offset)#is_spill then
590601 ()
602+ else
603+ let sslot = H. find stackslots offset in
604+ if sslot#is_compatible_with_spill then
605+ let sslot = mk_stackslot () in
606+ H. replace stackslots offset sslot
591607 else
592608 let sslot = H. find stackslots offset in
593609 raise
0 commit comments