summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2017-06-15 13:36:36 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2017-06-15 13:36:36 +0900
commitaf6041f1d09fc39b65c66ecc87fc63b9caead280 (patch)
treecbe843579996becb1a6b6986646e379090911214
parentbb1bfaa2fbc693a7185226737022d5d74b97a1de (diff)
downloadmruby-af6041f1d09fc39b65c66ecc87fc63b9caead280.tar.gz
mruby-af6041f1d09fc39b65c66ecc87fc63b9caead280.zip
Ensure size of the stack in OP_CALL.
-rw-r--r--src/vm.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/vm.c b/src/vm.c
index 4b121cecb..5853ba9e2 100644
--- a/src/vm.c
+++ b/src/vm.c
@@ -1434,14 +1434,13 @@ RETRY_TRY_BLOCK:
pool = irep->pool;
syms = irep->syms;
ci->nregs = irep->nregs;
+ stack_extend(mrb, irep->nregs);
if (ci->argc < 0) {
if (irep->nregs > 3) {
- stack_extend(mrb, irep->nregs);
stack_clear(regs+3, irep->nregs-3);
}
}
else if (ci->argc+2 < irep->nregs) {
- stack_extend(mrb, irep->nregs);
stack_clear(regs+ci->argc+2, irep->nregs-ci->argc-2);
}
if (m->env) {