Skip to content

Commit 36a793e

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

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
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

src/tapedtask.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ function Base.copy(t::TapedTask; args=())
174174
# the task is running, we find the real args from the copied bindings
175175
map(1:length(t.args)) do i
176176
s = i + 1
177-
haskey(tf.slots, s) ? tf.bindinds[tf.slots[s]] : t.args[i]
177+
haskey(tf.slots, s) ? tf.bindings[tf.slots[s]] : t.args[i]
178178
end
179179
else
180180
# the task is not started yet, but no args is given

0 commit comments

Comments
 (0)