summaryrefslogtreecommitdiffhomepage
path: root/mrbgems
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2021-12-01 14:26:22 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2021-12-01 14:26:22 +0900
commit2e2f81a443f0af24da877aa8c39a1aef2badde3c (patch)
treee51210007ef88b7be166925d54431537eb0d978a /mrbgems
parent7a31a1743a789555b3b3ecbd2624023efe686549 (diff)
downloadmruby-2e2f81a443f0af24da877aa8c39a1aef2badde3c.tar.gz
mruby-2e2f81a443f0af24da877aa8c39a1aef2badde3c.zip
codegen.c: `get_int_operand` to retrieve negative values correctly.
Diffstat (limited to 'mrbgems')
-rw-r--r--mrbgems/mruby-compiler/core/codegen.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mrbgems/mruby-compiler/core/codegen.c b/mrbgems/mruby-compiler/core/codegen.c
index c48e0d045..fa755e1e7 100644
--- a/mrbgems/mruby-compiler/core/codegen.c
+++ b/mrbgems/mruby-compiler/core/codegen.c
@@ -729,7 +729,7 @@ get_int_operand(codegen_scope *s, struct mrb_insn_data *data, mrb_int *n)
case OP_LOADI:
case OP_LOADI16:
- *n = data->b;
+ *n = (int16_t)data->b;
return TRUE;
case OP_LOADI32: