mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
compile.c: defined? with empty expression
* 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/trunk@40124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7862695406
commit
0c5d73e80b
3 changed files with 16 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Fri Apr 5 19:39:52 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* compile.c (iseq_compile_each): fix of defined? with empty
|
||||||
|
expression. [ruby-core:53999] [Bug #8220]
|
||||||
|
|
||||||
Fri Apr 5 13:22:59 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Fri Apr 5 13:22:59 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* ext/curses/curses.c (Init_curses): fix implementation function,
|
* ext/curses/curses.c (Init_curses): fix implementation function,
|
||||||
|
|
|
@ -5175,7 +5175,12 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case NODE_DEFINED:{
|
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];
|
LABEL *lfinish[2];
|
||||||
lfinish[0] = NEW_LABEL(line);
|
lfinish[0] = NEW_LABEL(line);
|
||||||
lfinish[1] = 0;
|
lfinish[1] = 0;
|
||||||
|
|
|
@ -13,6 +13,11 @@ class TestSyntax < Test::Unit::TestCase
|
||||||
eom
|
eom
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_defined_empty_argument
|
||||||
|
bug8220 = '[ruby-core:53999] [Bug #8220]'
|
||||||
|
assert_ruby_status(%w[--disable-gem], 'puts defined? ()', bug8220)
|
||||||
|
end
|
||||||
|
|
||||||
def test_must_ascii_compatible
|
def test_must_ascii_compatible
|
||||||
require 'tempfile'
|
require 'tempfile'
|
||||||
f = Tempfile.new("must_ac_")
|
f = Tempfile.new("must_ac_")
|
||||||
|
|
Loading…
Add table
Reference in a new issue