diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-11-07 09:14:44 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-11-07 09:14:44 +0900 |
| commit | cba07b02755711630e418fcf361d94cf47bb6730 (patch) | |
| tree | 9a3fa27224a07b69dc86f50410d20b2b03b44e7c /src | |
| parent | b6a73f99bf11c39a457a180a97a6a3bb36529a9c (diff) | |
| download | mruby-cba07b02755711630e418fcf361d94cf47bb6730.tar.gz mruby-cba07b02755711630e418fcf361d94cf47bb6730.zip | |
type check before pool scan
Diffstat (limited to 'src')
| -rw-r--r-- | src/codegen.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/codegen.c b/src/codegen.c index cf844b9ab..0e9ad0ebb 100644 --- a/src/codegen.c +++ b/src/codegen.c @@ -414,12 +414,14 @@ new_lit(codegen_scope *s, mrb_value val) case MRB_TT_FLOAT: for (i=0; i<s->irep->plen; i++) { pv = &s->irep->pool[i]; + if (pv->type != MRB_TT_FLOAT) continue; if (pv->value.f == mrb_float(val)) return i; } break; case MRB_TT_FIXNUM: for (i=0; i<s->irep->plen; i++) { pv = &s->irep->pool[i]; + if (pv->type != MRB_TT_FIXNUM) continue; if (pv->value.i == mrb_fixnum(val)) return i; } break; |
