diff --git a/src/interpret.jl b/src/interpret.jl index 979997a2..119524e2 100644 --- a/src/interpret.jl +++ b/src/interpret.jl @@ -550,6 +550,8 @@ function step_expr!(@nospecialize(recurse), frame::Frame, @nospecialize(node), i error("unexpected error statement ", node) elseif node.head === :incomplete error("incomplete statement ", node) + elseif node.head === :latestworld + frame.world = Base.get_world_counter() else rhs = eval_rhs(recurse, frame, node) end diff --git a/src/types.jl b/src/types.jl index 041a5b84..ad935213 100644 --- a/src/types.jl +++ b/src/types.jl @@ -253,8 +253,11 @@ mutable struct Frame caller::Union{Frame,Nothing} callee::Union{Frame,Nothing} last_codeloc::Int + # TODO: This is incompletely implemented + world::UInt end -function Frame(framecode::FrameCode, framedata::FrameData, pc=1, caller=nothing) +function Frame(framecode::FrameCode, framedata::FrameData, pc=1, caller=nothing, + world=isdefined(Base, :tls_world_age) ? Base.tls_world_age() : Base.get_world_counter()) if length(junk_frames) > 0 frame = pop!(junk_frames) frame.framecode = framecode @@ -264,9 +267,10 @@ function Frame(framecode::FrameCode, framedata::FrameData, pc=1, caller=nothing) frame.caller = caller frame.callee = nothing frame.last_codeloc = 0 + frame.world = world return frame else - return Frame(framecode, framedata, pc, 1, caller, nothing, 0) + return Frame(framecode, framedata, pc, 1, caller, nothing, 0, world) end end """