mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
should use non NULL scope for raise_error(); ref #2547
This commit is contained in:
+2
-2
@@ -554,7 +554,7 @@ for_body(codegen_scope *s, node *tree)
|
||||
/* generate loop-block */
|
||||
s = scope_new(s->mrb, s, NULL);
|
||||
if (s == NULL) {
|
||||
raise_error(s, "unexpected scope");
|
||||
raise_error(prev, "unexpected scope");
|
||||
}
|
||||
|
||||
push(); /* push for a block parameter */
|
||||
@@ -595,7 +595,7 @@ lambda_body(codegen_scope *s, node *tree, int blk)
|
||||
codegen_scope *parent = s;
|
||||
s = scope_new(s->mrb, s, tree->car);
|
||||
if (s == NULL) {
|
||||
raise_error(s, "unexpected scope");
|
||||
raise_error(parent, "unexpected scope");
|
||||
}
|
||||
|
||||
s->mscope = !blk;
|
||||
|
||||
Reference in New Issue
Block a user