Skip to content

Commit

Permalink
interp.c: remove two assertions that cannot be checked without the pa…
Browse files Browse the repository at this point in the history
…ge table

`!Is_in_value_area(pc)` is always false if we turn the page table off.
A better check would be `caml_find_code_fragment_by_pc(pc) != NULL`,
but I feel this is too costly even for the debug mode of the interpreter.
  • Loading branch information
xavierleroy committed Jun 15, 2020
1 parent 9aff4e6 commit 00ad7fb
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions runtime/interp.c
Expand Up @@ -538,7 +538,6 @@ value caml_interprete(code_t prog, asize_t prog_size)
Alloc_small(accu, num_args + 3, Closure_tag);
Field(accu, 2) = env;
for (i = 0; i < num_args; i++) Field(accu, i + 3) = sp[i];
CAMLassert(!Is_in_value_area(pc-3));
Code_val(accu) = pc - 3; /* Point to the preceding RESTART instr. */
Closinfo_val(accu) = Make_closinfo(0, 2);
sp += num_args;
Expand Down Expand Up @@ -567,7 +566,6 @@ value caml_interprete(code_t prog, asize_t prog_size)
}
/* The code pointer is not in the heap, so no need to go through
caml_initialize. */
CAMLassert(!Is_in_value_area(pc + *pc));
Code_val(accu) = pc + *pc;
Closinfo_val(accu) = Make_closinfo(0, 2);
pc++;
Expand Down

0 comments on commit 00ad7fb

Please sign in to comment.