diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-12-15 23:07:13 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-12-15 23:07:13 +0900 |
| commit | a3d240c2edb86671cea3e5b46987739fd9484fd6 (patch) | |
| tree | 8cd957831c7b0967aaf1a143536d07b9fe9da936 /src/dump.c | |
| parent | f5e10c5a79a17939af763b1dcf5232ce47e24a34 (diff) | |
| parent | fa33a5bb0cf08a5ba7405ab1553655bcfabee8cf (diff) | |
| download | mruby-a3d240c2edb86671cea3e5b46987739fd9484fd6.tar.gz mruby-a3d240c2edb86671cea3e5b46987739fd9484fd6.zip | |
Merge pull request #5599 from dearblue/loss-digits
Avoid losing the upper digits for mruby binary
Diffstat (limited to 'src/dump.c')
| -rw-r--r-- | src/dump.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dump.c b/src/dump.c index 4327cb375..2b7379d8e 100644 --- a/src/dump.c +++ b/src/dump.c @@ -51,7 +51,7 @@ get_iseq_block_size(mrb_state *mrb, const mrb_irep *irep) size_t size = 0; size += sizeof(uint16_t); /* clen */ - size += sizeof(uint16_t); /* ilen */ + size += sizeof(uint32_t); /* ilen */ size += irep->ilen * sizeof(mrb_code); /* iseq(n) */ size += irep->clen * sizeof(struct mrb_irep_catch_handler); @@ -66,7 +66,7 @@ write_iseq_block(mrb_state *mrb, const mrb_irep *irep, uint8_t *buf, uint8_t fla irep->clen * sizeof(struct mrb_irep_catch_handler); cur += uint16_to_bin(irep->clen, cur); /* number of catch handlers */ - cur += uint16_to_bin(irep->ilen, cur); /* number of opcode */ + cur += uint32_to_bin(irep->ilen, cur); /* number of opcode */ memcpy(cur, irep->iseq, seqlen); cur += seqlen; |
