Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

fix: broken variable reference, use 'next' statement #521

Merged
merged 1 commit into from

1 participant

@ghost

Because the tree is gone pop() even if it is empty.

#520

Kouki Ooyatsu fix: broken variable reference, use 'next' statement
 Because the tree is gone pop() even if it is empty.
3569942
@matz matz merged commit 604e39b into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 31, 2012
  1. fix: broken variable reference, use 'next' statement

    Kouki Ooyatsu authored
     Because the tree is gone pop() even if it is empty.
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/codegen.c
View
6 src/codegen.c
@@ -1556,8 +1556,10 @@ codegen(codegen_scope *s, node *tree, int val)
genop(s, MKOP_sBx(OP_JMP, s->loop->pc1 - s->pc));
}
else {
- codegen(s, tree, VAL);
- pop();
+ if (tree) {
+ codegen(s, tree, VAL);
+ pop();
+ }
genop_peep(s, MKOP_AB(OP_RETURN, cursp(), OP_R_NORMAL), NOVAL);
}
if (val) push();
Something went wrong with that request. Please try again.