summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>2021-01-11 14:58:40 -0500
committerAlan Wu <XrXr@users.noreply.github.com>2021-10-20 18:19:26 -0400
commit7e60ce357b7061ea6e638cab2ff656df031f7d90 (patch)
tree34c5390bf376daebc83dea7c922ee9ce6ff4dfce
parent2cc0db12fee25b23d689a9a9936db470d0fa0433 (diff)
Fix uint cast bug caught by Alan
-rw-r--r--ujit_codegen.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/ujit_codegen.c b/ujit_codegen.c
index 5c8e393205..a9462622ae 100644
--- a/ujit_codegen.c
+++ b/ujit_codegen.c
@@ -1006,8 +1006,7 @@ static bool
gen_jump(jitstate_t* jit, ctx_t* ctx)
{
// Get the branch target instruction offsets
- uint32_t next_idx = jit_next_idx(jit);
- uint32_t jump_idx = next_idx + (uint32_t)jit_get_arg(jit, 0);
+ uint32_t jump_idx = jit_next_idx(jit) + (int32_t)jit_get_arg(jit, 0);
blockid_t jump_block = { jit->iseq, jump_idx };
//
@@ -1015,9 +1014,6 @@ gen_jump(jitstate_t* jit, ctx_t* ctx)
// RUBY_VM_CHECK_INTS(ec);
//
- //print_str(cb, "jump!");
- //print_int(cb, imm_opnd(jump_idx));
-
// If the jump target was already compiled
if (find_block_version(jump_block, ctx))
{