summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-30 13:15:03 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-30 13:15:03 +0000
commite0a264a9ef5f15e41f8109117d3372e69ae73181 (patch)
tree00c408dfa9a14eae0e817934a3740da393bcdd57 /compile.c
parent6a734c810c09a1eb40ed1382bfda59fc7d389cb2 (diff)
* compile.c (defined_expr): fix SEGV by defined?([1]).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/compile.c b/compile.c
index a91b48ce2f..f92f58cb64 100644
--- a/compile.c
+++ b/compile.c
@@ -2327,18 +2327,10 @@ defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *ret,
do {
defined_expr(iseq, ret, vals->nd_head, lfinish, Qfalse);
- if (lfinish[1]) {
- ADD_INSNL(ret, nd_line(node), branchunless, lfinish[1]);
- }
- else {
- LABEL *lcont = NEW_LABEL(nd_line(node));
+ if (!lfinish[1]) {
lfinish[1] = NEW_LABEL(nd_line(node));
- ADD_INSNL(ret, nd_line(node), branchif, lcont);
- ADD_LABEL(ret, lfinish[1]);
- ADD_INSN(ret, nd_line(node), putnil);
- ADD_INSNL(ret, nd_line(node), jump, lfinish[0]);
- ADD_LABEL(ret, lcont);
}
+ ADD_INSNL(ret, nd_line(node), branchunless, lfinish[1]);
} while ((vals = vals->nd_next) != NULL);
}
case NODE_STR: