summaryrefslogtreecommitdiffhomepage
path: root/src/vm.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2017-04-10 21:12:41 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2017-04-10 21:12:41 +0900
commit0048dd118a0d57ff87265593819f9e93e05fafed (patch)
tree5115618de51eb7dba2713ce94e58dbf0b03db2df /src/vm.c
parenta55b237d89e1397da8dc879b24c1a34e80ad4e91 (diff)
downloadmruby-0048dd118a0d57ff87265593819f9e93e05fafed.tar.gz
mruby-0048dd118a0d57ff87265593819f9e93e05fafed.zip
Protect arguments from GC; fix #3597
GC may be called with OP_ENTER (especially when GC_STRESS is set).
Diffstat (limited to 'src/vm.c')
-rw-r--r--src/vm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vm.c b/src/vm.c
index 1b967ef7e..0a99e5f41 100644
--- a/src/vm.c
+++ b/src/vm.c
@@ -1589,7 +1589,6 @@ RETRY_TRY_BLOCK:
argc = mrb_ary_ptr(argv[0])->len;
argv = mrb_ary_ptr(argv[0])->ptr;
}
- mrb->c->ci->argc = len;
if (argc < len) {
int mlen = m2;
if (argc < m1+m2) {
@@ -1639,6 +1638,7 @@ RETRY_TRY_BLOCK:
}
pc += o + 1;
}
+ mrb->c->ci->argc = len;
/* clear local (but non-argument) variables */
if (irep->nlocals-len-2 > 0) {
stack_clear(&regs[len+2], irep->nlocals-len-2);