diff --git a/byterun/interp.c b/byterun/interp.c index d061cc7263e8..8d7f9b902322 100644 --- a/byterun/interp.c +++ b/byterun/interp.c @@ -1061,8 +1061,20 @@ value caml_interprete(code_t prog, asize_t prog_size) accu = (value)((((intnat) accu - 1) >> Long_val(*sp++)) | 1); Next; #define Integer_comparison(typ,opname,tst) \ - Instruct(opname): \ - accu = Val_int((typ) accu tst (typ) *sp++); Next; + Instruct(opname): { \ + if (Is_long (accu) || Is_long(*sp)) { \ + accu = Val_int((typ) accu tst (typ) *sp++); \ + Next; \ + } \ + if (Is_promoted_hd(Hd_val(accu)) && Is_young(accu)) \ + accu = caml_addrmap_lookup(&caml_remembered_set.promotion, accu); \ + value v2 = *(value*)sp; \ + if (Is_promoted_hd(Hd_val(v2)) && Is_young(v2)) \ + v2 = caml_addrmap_lookup(&caml_remembered_set.promotion, v2); \ + accu = Val_int((typ) accu tst (typ) v2); \ + sp++; \ + Next; \ + } Integer_comparison(intnat,EQ, ==) Integer_comparison(intnat,NEQ, !=)