codegen: reserve stack region for OP_APOST; fix #2824

This commit is contained in:
Yukihiro "Matz" Matsumoto
2015-08-10 14:55:48 +09:00
parent 5af770cd59
commit b34ee9a4b4
+13
View File
@@ -406,7 +406,18 @@ push_(codegen_scope *s)
nregs_update;
}
static void
push_n_(codegen_scope *s, size_t n)
{
if (s->sp+n > 511) {
codegen_error(s, "too complex expression");
}
s->sp+=n;
nregs_update;
}
#define push() push_(s)
#define push_n(n) push_n_(s,n)
#define pop_(s) ((s)->sp--)
#define pop() pop_(s)
#define pop_n(n) (s->sp-=(n))
@@ -1001,6 +1012,8 @@ gen_vmassignment(codegen_scope *s, node *tree, int rhs, int val)
else {
pop();
}
push_n(post);
pop_n(post);
genop(s, MKOP_ABC(OP_APOST, cursp(), n, post));
n = 1;
if (t->car) { /* rest */