Project

General

Profile

Bug #14201

Regression due to over optimization of hash splat

Added by marcandre (Marc-Andre Lafortune) over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Target version:
ruby -v:
2.5.0-rc1 & trunk
[ruby-core:84340]

Description

The following doesn't print anything nor raise anything in 2.5.0-rc1 or trunk:

$ ruby -e "{**puts('hello')}; 42"

It should be the same as in Ruby 2.0-2.4:

hello
-e:1:in `<main>': no implicit conversion of nil into Hash (TypeError)

Note: If you try to use the hash (e.g. passing as argument, storing in variable), then the correct behavior takes place. Found this bug through DeepCover's test suite.


Related issues

Related to Ruby trunk - Bug #14459: Unexpected compile error in 2.5.0ClosedActions

Associated revisions

Revision 5c3f9641
Added by nobu (Nobuyoshi Nakada) over 1 year ago

compile.c: side effect in splat

  • compile.c (compile_array): splat which may have side effects should be compiled even if the result will be popped. [ruby-core:84340] [Bug #14201]

From: Nobuyoshi Nakada nobu@ruby-lang.org

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 61329
Added by nobu (Nobuyoshi Nakada) over 1 year ago

compile.c: side effect in splat

  • compile.c (compile_array): splat which may have side effects should be compiled even if the result will be popped. [ruby-core:84340] [Bug #14201]

From: Nobuyoshi Nakada nobu@ruby-lang.org

Revision 61329
Added by nobu (Nobuyoshi Nakada) over 1 year ago

compile.c: side effect in splat

  • compile.c (compile_array): splat which may have side effects should be compiled even if the result will be popped. [ruby-core:84340] [Bug #14201]

From: Nobuyoshi Nakada nobu@ruby-lang.org

Revision 61329
Added by nobu (Nobuyoshi Nakada) over 1 year ago

compile.c: side effect in splat

  • compile.c (compile_array): splat which may have side effects should be compiled even if the result will be popped. [ruby-core:84340] [Bug #14201]

From: Nobuyoshi Nakada nobu@ruby-lang.org

Revision 23beb594
Added by nobu (Nobuyoshi Nakada) over 1 year ago

compile.c: pop splat result

  • compile.c (compile_array): pop splat result without creating a new hash if the whole hash is popped. [ruby-core:84340] [Bug #14201]

From: Nobuyoshi Nakada nobu@ruby-lang.org

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 61331
Added by nobu (Nobuyoshi Nakada) over 1 year ago

compile.c: pop splat result

  • compile.c (compile_array): pop splat result without creating a new hash if the whole hash is popped. [ruby-core:84340] [Bug #14201]

From: Nobuyoshi Nakada nobu@ruby-lang.org

Revision 61331
Added by nobu (Nobuyoshi Nakada) over 1 year ago

compile.c: pop splat result

  • compile.c (compile_array): pop splat result without creating a new hash if the whole hash is popped. [ruby-core:84340] [Bug #14201]

From: Nobuyoshi Nakada nobu@ruby-lang.org

Revision 61331
Added by nobu (Nobuyoshi Nakada) over 1 year ago

compile.c: pop splat result

  • compile.c (compile_array): pop splat result without creating a new hash if the whole hash is popped. [ruby-core:84340] [Bug #14201]

From: Nobuyoshi Nakada nobu@ruby-lang.org

History

#1

Updated by nobu (Nobuyoshi Nakada) over 1 year ago

  • Status changed from Open to Closed

Applied in changeset trunk|r61329.


compile.c: side effect in splat

  • compile.c (compile_array): splat which may have side effects should be compiled even if the result will be popped. [ruby-core:84340] [Bug #14201]

From: Nobuyoshi Nakada nobu@ruby-lang.org

#2

Updated by wanabe (_ wanabe) about 1 year ago

  • Related to Bug #14459: Unexpected compile error in 2.5.0 added

Also available in: Atom PDF