Project

General

Profile

Actions

Bug #22002

closed

argument stack underflow (-1)

Bug #22002: argument stack underflow (-1)

Added by Anonymous 2 days ago. Updated 1 day ago.

Status:
Closed
Assignee:
Target version:
-
ruby -v:
ruby 4.0.1 (2026-01-13 revision e04267a14b) +PRISM [arm64-darwin25]
[ruby-core:125274]

Description

The following lines of code:

sleep(0.1) until defined?(@variable)

@variable

produce this error:

home@My-Air testing % bundle exec ruby test.rb
-- raw disasm--------
   trace: 1
   0000 jump                 <L000>                                      (   1)
 <L004> [sp: 0, unremovable: 1, refcnt: 1]
   0002 putnil                                                           (   1)
 <L005> [sp: 1, unremovable: 0, refcnt: 1]
   0003 pop                                                              (   1)
   0004 jump                 <L000>                                      (   1)
 <L001> [sp: 0, unremovable: 1, refcnt: 5]
   0006 putself                                                          (   1)
   0007 putobject            0.1                                         (   1)
   0009 opt_send_without_block <calldata:sleep, 1>                       (   1)
   0011 pop                                                              (   1)
 <L000> [sp: 0, unremovable: 0, refcnt: 2]
 <L012> [sp: 0, unremovable: 0, refcnt: 0]
*  0012 branchunless         <L001>                                      (   1)
   adjust: [label: 4]
   0014 putnil                                                           (   1)
 <L002> [sp: -1, unremovable: 0, refcnt: 4]
   0015 pop                                                              (   1)
   trace: 1
   0016 getinstancevariable  :@variable, <ivc:0>                         (   3)
   0019 leave                                                            (   3)
---------------------
test.rb:1: argument stack underflow (-1)
test.rb: compile error (SyntaxError)
Actions

Also available in: PDF Atom