Skip to content

Commit 7deef44

Browse files
authored
Fix for change in CodeInfo.slotnames type on julia master (#251)
1 parent 8912002 commit 7deef44

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

src/JuliaInterpreter.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ if VERSION < v"1.2.0-DEV.572"
3636
Base.convert(::Type{Some{T}}, x::Some{T}) where {T} = x
3737
end
3838

39+
const SlotNamesType = VERSION < v"1.2.0-DEV.606" ? Vector{Any} : Vector{Symbol}
40+
3941
include("types.jl")
4042
include("utils.jl")
4143
include("construct.jl")

src/construct.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ end
246246
function prepare_framedata(framecode, argvals::Vector{Any}, caller_will_catch_err::Bool=false)
247247
if isa(framecode.scope, Method)
248248
meth, src = framecode.scope::Method, framecode.src
249-
slotnames = src.slotnames::Vector{Any} # this is more strongly typed in julia.h than in jltypes.c
249+
slotnames = src.slotnames::SlotNamesType
250250
ssavt = src.ssavaluetypes
251251
ng = isa(ssavt, Int) ? ssavt : length(ssavt::Vector{Any})
252252
nargs, meth_nargs = length(argvals), Int(meth.nargs)

src/interpret.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ function do_assignment!(frame, @nospecialize(lhs), @nospecialize(rhs))
327327
data.ssavalues[lhs.id] = rhs
328328
elseif isa(lhs, SlotNumber)
329329
data.locals[lhs.id] = Some{Any}(rhs)
330-
slotnames = code.src.slotnames::Vector{Any}
330+
slotnames = code.src.slotnames::SlotNamesType
331331
data.last_reference[slotnames[lhs.id]::Symbol] = lhs.id
332332
elseif isa(lhs, GlobalRef)
333333
Core.eval(lhs.mod, :($(lhs.name) = $(QuoteNode(rhs))))

src/utils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ function locals(frame::Frame)
293293
vars = Variable[]
294294
data, code = frame.framedata, frame.framecode
295295
added = Set{Symbol}()
296-
slotnames = code.src.slotnames::Vector{Any}
296+
slotnames = code.src.slotnames::SlotNamesType
297297
for sym in slotnames
298298
sym added && continue
299299
idx = get(data.last_reference, sym, 0)

0 commit comments

Comments
 (0)