Skip to content

Commit cdbbe89

Browse files
committed
bugfix: unify TypedSlot and SlotNumber
1 parent 3ab024f commit cdbbe89

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/tapedfunction.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,8 @@ function bind_var!(var::QuoteNode, tbind::TempBindings, ir::Core.CodeInfo)
247247
bind_var!(eval(var), tbind, ir)
248248
end
249249
function bind_var!(var::Core.TypedSlot, tbind::TempBindings, ir::Core.CodeInfo)
250-
get!(tbind.book, var, allocate_binding!(var, tbind, ir.slottypes[var.id]))
250+
# turn TypedSlot to SlotNumber
251+
bind_var!(Core.SlotNumber(var.id), tbind, ir)
251252
end
252253
function bind_var!(var::Core.SlotNumber, tbind::TempBindings, ir::Core.CodeInfo)
253254
get!(tbind.book, var, allocate_binding!(var, tbind, ir.slottypes[var.id]))
@@ -280,7 +281,7 @@ function translate!(tape::RawTape, ir::Core.CodeInfo)
280281
push!(tape, ins)
281282
end
282283
for (k, v) in bcache
283-
isa(k, Union{Core.TypedSlot, Core.SlotNumber}) && (slots[k.id] = v)
284+
isa(k, Core.SlotNumber) && (slots[k.id] = v)
284285
end
285286
return (bindings, slots, tape)
286287
end

0 commit comments

Comments
 (0)