Skip to content

Commit 153e235

Browse files
authored
use last_reference instead for locals (#94)
1 parent 6068a48 commit 153e235

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/JuliaInterpreter.jl

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -184,14 +184,8 @@ Return the local variables as a vector of `Variable`[@ref].
184184
"""
185185
function locals(frame::JuliaStackFrame)
186186
vars = Variable[]
187-
syms = Set{Symbol}()
188-
for i = length(frame.locals):-1:1
189-
if !isa(frame.locals[i], Nothing)
190-
sym = frame.code.code.slotnames[i]
191-
sym in syms && continue
192-
push!(vars, Variable(something(frame.locals[i]), sym, false))
193-
push!(syms, sym)
194-
end
187+
for (sym, idx) in frame.last_reference
188+
push!(vars, Variable(something(frame.locals[idx]), sym, false))
195189
end
196190
reverse!(vars)
197191
if frame.code.scope isa Method

0 commit comments

Comments
 (0)