restore arena_idx after reading irep

This commit is contained in:
Yukihiro Matsumoto
2012-05-29 09:31:12 +09:00
parent d8cd21be45
commit 0dd5e0eba6
+2
View File
@@ -502,6 +502,7 @@ mrb_read_irep(mrb_state *mrb, const char *bin)
uint32_t len = 0;
unsigned char *src;
rite_binary_header bin_header;
int ai = mrb->arena_idx;
if ((mrb == NULL) || (bin == NULL)) {
return MRB_DUMP_INVALID_ARGUMENT;
@@ -539,6 +540,7 @@ mrb_read_irep(mrb_state *mrb, const char *bin)
mrb->irep_len += nirep;
error_exit:
mrb->arena_idx = ai;
if (ret != MRB_DUMP_OK) {
for (n=0,i=sirep; n<nirep; n++,i++) {
if (mrb->irep[i]) {