Skip to content

Commit 02deb93

Browse files
committed
fix typo in whereis
1 parent 1b844be commit 02deb93

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/utils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ function CodeTracking.whereis(framecode::FrameCode, pc)
168168
codeloc == 0 && return nothing
169169
lineinfo = framecode.src.linetable[codeloc]
170170
return isa(framecode.scope, Method) ?
171-
whereis(lineinfo, framecode.scope) : getfile(lineinfo), getline(lineinfo)
171+
whereis(lineinfo, framecode.scope) : (getfile(lineinfo), getline(lineinfo))
172172
end
173173
CodeTracking.whereis(frame::Frame, pc=frame.pc) = whereis(frame.framecode, pc)
174174

test/interpret.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,3 +384,10 @@ end
384384
x = Union{Array{UInt8,N},Array{Int8,N}} where N
385385
@test isa(JuliaInterpreter.prepare_call(varargidentity, [varargidentity, x])[1], JuliaInterpreter.FrameCode)
386386
end
387+
388+
# Test return value of whereis
389+
f() = nothing
390+
fr = JuliaInterpreter.enter_call(f)
391+
file, line = JuliaInterpreter.whereis(fr)
392+
@test file == @__FILE__
393+
@test line == (@__LINE__() - 4)

0 commit comments

Comments
 (0)