Merge pull request #1039 from crimsonwoods/fix_the_type_of_opcode

Fix the type of value that is returned by bit shift expression.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2013-03-22 19:11:51 -07:00
4 changed files with 16 additions and 12 deletions
+4 -3
View File
@@ -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)