From: "k0kubun (Takashi Kokubun) via ruby-core" Date: 2026-05-11T21:01:42+00:00 Subject: [ruby-core:125465] [Ruby Bug#22002] argument stack underflow (-1) Issue #22002 has been updated by k0kubun (Takashi Kokubun). Backport changed from 3.3: DONTNEED, 3.4: REQUIRED, 4.0: REQUIRED to 3.3: DONTNEED, 3.4: REQUIRED, 4.0: DONE ruby_4_0 commit:a9e4608b5225d665ec9c9353a8350f5b940c20fe merged revision(s) commit:d077df24a2256d760cc534b242b28822d4ef6376. ---------------------------------------- Bug #22002: argument stack underflow (-1) https://bugs.ruby-lang.org/issues/22002#change-117273 * Author: Anonymous * Status: Closed * Assignee: prism * ruby -v: ruby 4.0.1 (2026-01-13 revision e04267a14b) +PRISM [arm64-darwin25] * Backport: 3.3: DONTNEED, 3.4: REQUIRED, 4.0: DONE ---------------------------------------- The following lines of code: ```ruby 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 ( 1) [sp: 0, unremovable: 1, refcnt: 1] 0002 putnil ( 1) [sp: 1, unremovable: 0, refcnt: 1] 0003 pop ( 1) 0004 jump ( 1) [sp: 0, unremovable: 1, refcnt: 5] 0006 putself ( 1) 0007 putobject 0.1 ( 1) 0009 opt_send_without_block ( 1) 0011 pop ( 1) [sp: 0, unremovable: 0, refcnt: 2] [sp: 0, unremovable: 0, refcnt: 0] * 0012 branchunless ( 1) adjust: [label: 4] 0014 putnil ( 1) [sp: -1, unremovable: 0, refcnt: 4] 0015 pop ( 1) trace: 1 0016 getinstancevariable :@variable, ( 3) 0019 leave ( 3) --------------------- test.rb:1: argument stack underflow (-1) test.rb: compile error (SyntaxError) ``` -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/