mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
codegen: reserve stack region for OP_APOST; fix #2824
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user