diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-03-22 19:11:51 -0700 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-03-22 19:11:51 -0700 |
| commit | acab35a2a54e00e197b7372e940b83235480179d (patch) | |
| tree | b8ec207c86e6f9e270c04799c5cb7d59354acac6 /src/codegen.c | |
| parent | 04d9c5ea6bfbdaf425526cf3556704f6b9fd0971 (diff) | |
| parent | f4b943771881b01b40b34ca38ccdd62bb5eaaa66 (diff) | |
| download | mruby-acab35a2a54e00e197b7372e940b83235480179d.tar.gz mruby-acab35a2a54e00e197b7372e940b83235480179d.zip | |
Merge pull request #1039 from crimsonwoods/fix_the_type_of_opcode
Fix the type of value that is returned by bit shift expression.
Diffstat (limited to 'src/codegen.c')
| -rw-r--r-- | src/codegen.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/codegen.c b/src/codegen.c index 909bd5f7d..30efa248e 100644 --- a/src/codegen.c +++ b/src/codegen.c @@ -580,7 +580,8 @@ lambda_body(codegen_scope *s, node *tree, int blk) } tree = tree->cdr; if (tree->car) { - int ma, oa, ra, pa, ka, kd, ba, a; + int32_t a; + int ma, oa, ra, pa, ka, kd, ba; int pos, i; node *n, *opt; @@ -595,8 +596,8 @@ lambda_body(codegen_scope *s, node *tree, int blk) ka = kd = 0; ba = tree->car->cdr->cdr->cdr->cdr ? 1 : 0; - a = ((ma & 0x1f) << 18) - | ((oa & 0x1f) << 13) + a = ((int32_t)(ma & 0x1f) << 18) + | ((int32_t)(oa & 0x1f) << 13) | ((ra & 1) << 12) | ((pa & 0x1f) << 7) | ((ka & 0x1f) << 2) |
