Bug #4290: !_=%w~ dumps core
http://redmine.ruby-lang.org/issues/show/4290

ɼ???: Yusuke Endoh
?????????: Open, ?????: Normal
???????: Yusuke Endoh, Target version: 1.9.3
ruby -v: ruby 1.9.3dev (2011-01-18 trunk 30590) [i686-linux]

???????????

以????? SEGV ??????????

  $ ./miniruby -e '!_=%w~'
  -e:1: unterminated string meets end of file
  ./miniruby: [BUG] Segmentation fault
  ruby 1.9.3dev (2011-01-18 trunk 30590) [i686-linux]

??件??代???????????????? %w ???置???起???????????????????


diff --git a/parse.y b/parse.y
index bbe842e..b4ee019 100644
--- a/parse.y
+++ b/parse.y
@@ -8684,6 +8684,7 @@ assign_in_cond(struct parser_params *parser, NODE *node)
 	return 0;
     }

+    if (!node->nd_value) return 1;
     switch (nd_type(node->nd_value)) {
       case NODE_LIT:
       case NODE_STR:

-- 
Yusuke Endoh <mame / tsg.ne.jp>


----------------------------------------
http://redmine.ruby-lang.org