Project

General

Profile

Bug #14708

argument stack underflow (-1) (SyntaxError)

Added by tim.leppard (Tim Leppard) over 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
[ruby-core:86666]

Description

ruby -e '[].each { false || [].each { } }' # OK

ruby -e '[].each { nil.nil? || [].each { } }' # OK

ruby -e '[].each { true || [].each { } }'

-- raw disasm--------
 <L498253648>
 trace: 100
 0000 nop                                                              (   1)
 <L000>
 trace: 1
 0001 putobject            true                                        (   1)
 0003 leave                                                            (   1)
 0004 pop                                                              (   1)
*0005 pop                                                              (   1)
 <L003>
 0006 newarray             0                                           (   1)
 0008 send                 <callinfo:each, 0>, <call cache>, nil       (   1)
 <L004>
 <L001>
 trace: 200
 0012 leave                                                            (   1)
---------------------
Traceback (most recent call last):
-e: -e:1: argument stack underflow (-1) (SyntaxError)
#1

Updated by nobu (Nobuyoshi Nakada) over 2 years ago

  • Backport changed from 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN to 2.3: DONTNEED, 2.4: DONTNEED, 2.5: REQUIRED
#2

Updated by nobu (Nobuyoshi Nakada) over 2 years ago

  • Status changed from Open to Closed

Applied in changeset trunk|r63255.


compile.c: fix unconditional branch optimization

  • compile.c (iseq_peephole_optimize): add dummy putnil after a jump replacing an unconditional branch, to adjust removed dup. [ruby-core:86666] [Bug #14708]

Updated by nagachika (Tomoyuki Chikanaga) almost 2 years ago

  • Backport changed from 2.3: DONTNEED, 2.4: DONTNEED, 2.5: REQUIRED to 2.3: DONTNEED, 2.4: DONTNEED, 2.5: DONE

ruby_2_5 r64419 merged revision(s) 63255.

Also available in: Atom PDF