From: "k0kubun (Takashi Kokubun) via ruby-core" Date: 2025-07-14T21:08:01+00:00 Subject: [ruby-core:122754] [Ruby Bug#21439] Crash with PM_SPLAT_NODE compiler error (Prism) Issue #21439 has been updated by k0kubun (Takashi Kokubun). Backport changed from 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: REQUIRED to 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: DONE ruby_3_4 commit:585469aff3de855a9f3db8e51f12bf87300981af merged revision(s) commit:5ec9a392cdf7f971221dc073dd466bce877d8acb. ---------------------------------------- Bug #21439: Crash with PM_SPLAT_NODE compiler error (Prism) https://bugs.ruby-lang.org/issues/21439#change-114033 * Author: bendrissou (Bachir Bendrissou) * Status: Closed * Assignee: prism * ruby -v: 3.5.0 * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: DONE ---------------------------------------- Hi Ruby team, I'm encountering a crash when using a splat (*) on the left-hand side of a for loop in the latest Ruby build from master. The error occurs during compilation, and seems related to Prism���s handling of PM_SPLAT_NODE. ### Input The following minimal script crashes: ``` for *y in [4, 5] p y end ``` ### Expected Output ``` [4] [5] ``` ### Actual Output ``` bug-1.rb: [BUG] Unexpected node type for index in for node: PM_SPLAT_NODE ruby 3.5.0dev (2025-06-11T18:07:43Z master 970813d982) +PRISM [x86_64-linux] -- Control frame information ----------------------------------------------- c:0001 p:0000 s:0003 E:000720 DUMMY [FINISH] -- Threading information --------------------------------------------------- Total ractor count: 1 Ruby thread count for this ractor: 1 -- C level backtrace information ------------------------------------------- /lib/x86_64-linux-gnu/libasan.so.5(__interceptor_backtrace+0x40) [0x7f13b793bd40] ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:4022 /home/ruby/build/ruby(rb_print_backtrace+0x11) [0x558d33041da9] ../vm_dump.c:843 /home/ruby/build/ruby(rb_vm_bugreport) ../vm_dump.c:1175 /home/ruby/build/ruby(rb_bug_without_die_internal+0xc5) [0x558d32704b21] ../error.c:1097 /home/ruby/build/ruby(rb_bug) ../error.c:1115 /home/ruby/build/ruby(pm_compile_for_node_index+0x117) [0x558d32ee742c] ../prism_compile.c:5340 /home/ruby/build/ruby(pm_compile_scope_node) ../prism_compile.c:6911 /home/ruby/build/ruby(pm_compile_node+0x1b50) [0x558d32e88490] ../prism_compile.c:10201 /home/ruby/build/ruby(pm_iseq_compile_node+0x437) [0x558d32eea437] ../prism_compile.c:10512 /home/ruby/build/ruby(pm_iseq_new_with_opt_try+0x3e) [0x558d32824c5e] ../iseq.c:1050 /home/ruby/build/ruby(rb_protect+0x30f) [0x558d327183ff] ../eval.c:1059 /home/ruby/build/ruby(pm_iseq_new_with_opt+0x482) [0x558d32832c12] ../iseq.c:1103 /home/ruby/build/ruby(pm_new_child_iseq+0x19a) [0x558d32dbdc7a] ../prism_compile.c:1261 /home/ruby/build/ruby(pm_compile_node+0x15296) [0x558d32e9bbd6] ../prism_compile.c:9199 /home/ruby/build/ruby(pm_compile_node+0x529d) [0x558d32e8bbdd] ../prism_compile.c:10330 /home/ruby/build/ruby(pm_compile_scope_node+0x3f42) [0x558d32ee3382] ../prism_compile.c:7012 /home/ruby/build/ruby(pm_compile_node+0x1b50) [0x558d32e88490] ../prism_compile.c:10201 /home/ruby/build/ruby(APPEND_LIST+0x0) [0x558d32eea2a4] ../prism_compile.c:10502 /home/ruby/build/ruby(pm_iseq_compile_node) ../prism_compile.c:10506 /home/ruby/build/ruby(pm_iseq_new_with_opt_try+0x3e) [0x558d32824c5e] ../iseq.c:1050 /home/ruby/build/ruby(rb_protect+0x30f) [0x558d327183ff] ../eval.c:1059 /home/ruby/build/ruby(pm_iseq_new_with_opt+0x482) [0x558d32832c12] ../iseq.c:1103 /home/ruby/build/ruby(pm_iseq_new_main+0xbc) [0x558d328332ac] ../iseq.c:951 /home/ruby/build/ruby(process_options+0x2d32) [0x558d329d2b12] ../ruby.c:2641 /home/ruby/build/ruby(ruby_process_options+0x3f0) [0x558d329d5290] ../ruby.c:3199 /home/ruby/build/ruby(ruby_options+0x2a7) [0x558d32715407] ../eval.c:117 /home/ruby/build/ruby(rb_main+0x19) [0x558d327067ff] ../main.c:42 /home/ruby/build/ruby(main) ../main.c:62 /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7f13b7487083] /home/ruby/build/ruby(_start) [0x558d32707dce] -- Other runtime information ----------------------------------------------- * Loaded script: bug-1.rb * Loaded features: 0 enumerator.so 1 thread.rb 2 fiber.so 3 rational.so 4 complex.so 5 ruby2_keywords.rb 6 set.rb Aborted ``` ### Environment Ruby version: `ruby 3.5.0dev (2025-06-11 commit 970813d982) +PRISM` Platform: `x86_64-linux` Built from source using latest master Parser backend: `Prism (default)` -- 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/