Bug #4290

!_=%w~ dumps core

Added by Yusuke Endoh over 3 years ago. Updated almost 3 years ago.

[ruby-dev:43067]
Status:Closed
Priority:Normal
Assignee:Yusuke Endoh
Category:-
Target version:1.9.3
ruby -v:ruby 1.9.3dev (2011-01-18 trunk 30590) [i686-linux] Backport:

Description

=begin
遠藤です。

以下で 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 @@ assignincond(struct parser_params *parser, NODE *node)
return 0;
}

  • if (!node->ndvalue) return 1;
    switch (nd
    type(node->ndvalue)) {
    case NODE
    LIT:
    case NODE_STR:

    Yusuke Endoh mame@tsg.ne.jp
    =end

History

#1 Updated by Yusuke Endoh over 3 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
This issue was solved with changeset r30597.
Yusuke, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • parse.y: avoid NULL reference. =end

Also available in: Atom PDF