Permalink
Browse files

Ignore empty ensure clause.

  • Loading branch information...
matz committed Feb 28, 2017
1 parent fb3243e commit dc56bbecc81b5d04d3bf9ab337f4ebf7024f654f
Showing with 6 additions and 1 deletion.
  1. +6 −1 mrbgems/mruby-compiler/core/codegen.c
@@ -1360,7 +1360,9 @@ codegen(codegen_scope *s, node *tree, int val)
break;
case NODE_ENSURE:
{
if (!tree->cdr || !tree->cdr->cdr ||
((intptr_t)tree->cdr->cdr->car == NODE_BEGIN &&
tree->cdr->cdr->cdr)) {
int idx;
int epush = s->pc;
@@ -1372,6 +1374,9 @@ codegen(codegen_scope *s, node *tree, int val)
s->ensure_level--;
genop_peep(s, MKOP_A(OP_EPOP, 1), NOVAL);
}
else { /* empty ensure ignored */
codegen(s, tree->car, val);
}
break;
case NODE_LAMBDA:

0 comments on commit dc56bbe

Please sign in to comment.