Skip to content

Commit 890d1cd

Browse files
Dale-Blackclaude
andcommitted
Add callable_overrides check for SSA callees in unoptimized IR
SignalGetter/SignalSetter calls in optimize=false closures appear as SSA callee calls, not :invoke. Check callable_overrides for the SSA's DataType before falling through to Core.Const resolution. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f5c6f6c commit 890d1cd

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/compiler/codegen.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,18 @@ function compile_call(ctx::JSCompilationContext, expr::Expr)
544544
# where %20 is an SSA holding Core.Const(push!). Resolve and dispatch.
545545
if callee isa Core.SSAValue
546546
callee_type = ctx.code_info.ssavaluetypes[callee.id]
547+
548+
# Check callable_overrides for struct types (SignalGetter, SignalSetter, etc.)
549+
if !isempty(ctx.callable_overrides)
550+
override_type = callee_type isa DataType ? callee_type : nothing
551+
if override_type !== nothing && haskey(ctx.callable_overrides, override_type)
552+
override_fn = ctx.callable_overrides[override_type]
553+
receiver_js = compile_value(ctx, callee)
554+
call_args_ov = [compile_value(ctx, a) for a in args[2:end]]
555+
return override_fn(receiver_js, call_args_ov)
556+
end
557+
end
558+
547559
if callee_type isa Core.Const
548560
resolved_fn = callee_type.val
549561
fn_name = string(nameof(resolved_fn))

0 commit comments

Comments
 (0)