diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-11-20 07:34:57 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-11-20 07:34:57 +0900 |
| commit | 16e1fbc1e89f0bbb45e369495ff9b6aebc08de34 (patch) | |
| tree | 8b4e7618106e2b7403fc1e93d84bf7d8913d4124 /src/dump.c | |
| parent | d73dfa87087879ca3b06e1f30a68a120549e0a57 (diff) | |
| download | mruby-16e1fbc1e89f0bbb45e369495ff9b6aebc08de34.tar.gz mruby-16e1fbc1e89f0bbb45e369495ff9b6aebc08de34.zip | |
mrb format should be portable among configurations (e.g. MRB_NAN_BOXING)
Diffstat (limited to 'src/dump.c')
| -rw-r--r-- | src/dump.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/dump.c b/src/dump.c index b10119b47..97c07afcd 100644 --- a/src/dump.c +++ b/src/dump.c @@ -118,21 +118,22 @@ write_pool_block(mrb_state *mrb, mrb_irep *irep, uint8_t *buf) for (pool_no = 0; pool_no < irep->plen; pool_no++) { int ai = mrb_gc_arena_save(mrb); - cur += uint8_to_bin(mrb_type(irep->pool[pool_no]), cur); /* data type */ - switch (mrb_type(irep->pool[pool_no])) { case MRB_TT_FIXNUM: + cur += uint8_to_bin(IREP_TT_FIXNUM, cur); /* data type */ str = mrb_fixnum_to_str(mrb, irep->pool[pool_no], 10); char_ptr = RSTRING_PTR(str); len = RSTRING_LEN(str); break; case MRB_TT_FLOAT: + cur += uint8_to_bin(IREP_TT_FLOAT, cur); /* data type */ len = mrb_float_to_str(char_buf, mrb_float(irep->pool[pool_no])); char_ptr = &char_buf[0]; break; case MRB_TT_STRING: + cur += uint8_to_bin(IREP_TT_STRING, cur); /* data type */ char_ptr = RSTRING_PTR(irep->pool[pool_no]); len = RSTRING_LEN(irep->pool[pool_no]); break; |
