From ed1d6660d129085f1aaf2d903eed1e2ea7ace098 Mon Sep 17 00:00:00 2001 From: nagachika Date: Mon, 15 Apr 2013 15:28:52 +0000 Subject: merge revision(s) 40124: [Backport #8220] * compile.c (iseq_compile_each): fix of defined? with empty expression. [ruby-core:53999] [Bug #8220] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@40312 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- compile.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'compile.c') diff --git a/compile.c b/compile.c index 14e285420f..2753cf80eb 100644 --- a/compile.c +++ b/compile.c @@ -5161,7 +5161,12 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped) break; } case NODE_DEFINED:{ - if (!poped) { + if (poped) break; + if (!node->nd_head) { + VALUE str = rb_iseq_defined_string(DEFINED_NIL); + ADD_INSN1(ret, nd_line(node), putobject, str); + } + else { LABEL *lfinish[2]; lfinish[0] = NEW_LABEL(line); lfinish[1] = 0; -- cgit v1.2.3