1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 19:50:24 +02:00

Fix JIT compilation for jtable

* libguile/jit.c (compile_jtable): Fix bounds check for index.
This commit is contained in:
Andy Wingo 2020-08-11 22:10:32 +02:00
parent de5d1a7f99
commit feafad7958

View file

@ -4393,7 +4393,7 @@ compile_jtable (scm_jit_state *j, uint32_t idx, uint32_t len,
add_inter_instruction_patch (j, high_word_nonzero, default_target); add_inter_instruction_patch (j, high_word_nonzero, default_target);
#endif #endif
jit_reloc_t out_of_range = jit_bgei_u (j->jit, T0, len); jit_reloc_t out_of_range = jit_bgei_u (j->jit, T0, len - 1);
add_inter_instruction_patch (j, out_of_range, default_target); add_inter_instruction_patch (j, out_of_range, default_target);
/* Now that we know that the u64 at IDX is in the table, load the /* Now that we know that the u64 at IDX is in the table, load the