Skip to content

Commit 4e0e26c

Browse files
committed
Fix a busted name
This only came up during errors, so was not caught in the API change
1 parent 4c924f9 commit 4e0e26c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/interpret.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ lookup_var(frame, ref::GlobalRef) = getfield(ref.mod, ref.name)
1010
function lookup_var(frame, slot::SlotNumber)
1111
val = frame.framedata.locals[slot.id]
1212
val !== nothing && return val.value
13-
error("slot ", slot, " with name ", frame.framecode.code.slotnames[slot.id], " not assigned")
13+
error("slot ", slot, " with name ", frame.framecode.src.slotnames[slot.id], " not assigned")
1414
end
1515

1616
function lookup_expr(frame, e::Expr)

test/interpret.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,8 @@ f113(;x) = x
334334
return x
335335
end
336336
frame = JuliaInterpreter.enter_call(f_multi, 1)
337+
nlocals = length(frame.framedata.locals)
338+
@test_throws ErrorException("slot _4 with name x not assigned") JuliaInterpreter.lookup_var(frame, Core.SlotNumber(nlocals))
337339
stack = [frame]
338340
locals = JuliaInterpreter.locals(frame)
339341
@test length(locals) == 2

0 commit comments

Comments
 (0)