Commit 854e2cb8
854e2cb8fa12Merged
Yukihiro "Matz" Matsumoto <[email protected]> · 5 months ago · 3 files · +2 added · ~1 modified
Description
Register the empty symbol literal :"" so it has a table entry
:"" is a real SymbolNode whose content is the empty string, but
collect_sym_names routes every symbol through collect_sym_name_into,
which skips "" to guard the param-name callers that can pass a blank.
With no table entry, compile_symbol_literal fell through to the
sp_sym_intern fallback -- a helper emitted only when the intern path is
otherwise needed -- so a bare :"" failed to link with undefined reference to sp_sym_intern.
Register the empty content directly in the SymbolNode arm (a SymbolNode
with "" content is unambiguously :""), so it gets a sym-table slot and
lowers to ((sp_sym)N) like any other non-identifier symbol.
Fixes #1321
Co-Authored-By: Claude Opus 4.8 [email protected]
Details
- Commit
- 854e2cb8fa12
- Parent
- 0408f5ac26d4
spinel_analyze.rbmodifiedView file
t = @nd_type[i] if t == "SymbolNode" sname = @nd_content[i] collect_sym_name_into(local, sname) # The empty symbol `:""` is a real SymbolNode whose content is "". # collect_sym_name_into skips "" (it guards param-name callers that # can pass a blank), so register it directly here; without an entry # compile_symbol_literal falls back to the unemitted sp_sym_intern. if sname == "" if not_in("", local) == 1 local.push("") end else collect_sym_name_into(local, sname) end end if t == "BlockNode" collect_proc_param_sym_names(local, i, 0)test/empty_symbol_literal.rbaddedView file
Loading diff…
test/empty_symbol_literal.rb.expectedaddedView file
Loading diff…