summaryrefslogtreecommitdiffhomepage
path: root/src/dump.c
diff options
context:
space:
mode:
authortake-cheeze <[email protected]>2018-11-02 15:34:35 +0900
committertake-cheeze <[email protected]>2018-11-02 15:47:28 +0900
commit659c680a5bbc04c736544741e2e16c27a3a3f374 (patch)
tree3ceb89617c9331c17a4d1d3aa6f2466407e3b1f2 /src/dump.c
parent0419f07915603f74bbd3f6435ffee42cde5eaa5f (diff)
downloadmruby-659c680a5bbc04c736544741e2e16c27a3a3f374.tar.gz
mruby-659c680a5bbc04c736544741e2e16c27a3a3f374.zip
Fix dump and load with endianess
Diffstat (limited to 'src/dump.c')
-rw-r--r--src/dump.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/src/dump.c b/src/dump.c
index df1e171e4..0b1344594 100644
--- a/src/dump.c
+++ b/src/dump.c
@@ -85,26 +85,8 @@ write_iseq_block(mrb_state *mrb, mrb_irep *irep, uint8_t *buf, uint8_t flags)
cur += uint32_to_bin(irep->ilen, cur); /* number of opcode */
cur += write_padding(cur);
- switch (flags & DUMP_ENDIAN_NAT) {
- case DUMP_ENDIAN_BIG:
- if (bigendian_p()) goto native;
- for (iseq_no = 0; iseq_no < irep->ilen; iseq_no++) {
- cur += uint32_to_bin(irep->iseq[iseq_no], cur); /* opcode */
- }
- break;
- case DUMP_ENDIAN_LIL:
- if (!bigendian_p()) goto native;
- for (iseq_no = 0; iseq_no < irep->ilen; iseq_no++) {
- cur += uint32l_to_bin(irep->iseq[iseq_no], cur); /* opcode */
- }
- break;
-
- native:
- case DUMP_ENDIAN_NAT:
- memcpy(cur, irep->iseq, irep->ilen * sizeof(mrb_code));
- cur += irep->ilen * sizeof(mrb_code);
- break;
- }
+ memcpy(cur, irep->iseq, irep->ilen * sizeof(mrb_code));
+ cur += irep->ilen * sizeof(mrb_code);
return cur - buf;
}