Skip to content

adjustments to v1.11 #629

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions src/interpret.jl
Original file line number Diff line number Diff line change
Expand Up @@ -372,17 +372,14 @@ function do_assignment!(frame, @nospecialize(lhs), @nospecialize(rhs))
counter = (frame.assignment_counter += 1)
data.locals[lhs.id] = Some{Any}(rhs)
data.last_reference[lhs.id] = counter
elseif isa(lhs, GlobalRef)
elseif isa(lhs, Symbol) || isa(lhs, GlobalRef)
mod = lhs isa Symbol ? moduleof(frame) : lhs.mod
name = lhs isa Symbol ? lhs : lhs.name
Core.eval(mod, Expr(:global, name))
@static if @isdefined setglobal!
setglobal!(lhs.mod, lhs.name, rhs)
setglobal!(mod, name, rhs)
else
ccall(:jl_set_global, Cvoid, (Any, Any, Any), lhs.mod, lhs.name, rhs)
end
elseif isa(lhs, Symbol)
@static if @isdefined setglobal!
setglobal!(moduleof(code), lhs, rhs)
else
ccall(:jl_set_global, Cvoid, (Any, Any, Any), moduleof(code), lhs, rhs)
ccall(:jl_set_global, Cvoid, (Any, Any, Any), mod, name, rhs)
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions test/breakpoints.jl
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ end
return 2
end
frame = JuliaInterpreter.enter_call(f_macro)
file_logging = "logging.jl"
file_logging = String(only(methods(var"@info")).file)
line_logging = 0
for entry in frame.framecode.src.linetable
if entry.file === Symbol(file_logging)
Expand All @@ -534,7 +534,7 @@ end
@test bp isa BreakpointRef
file, ln = JuliaInterpreter.whereis(frame)
@test ln == line_logging
@test basename(file) == file_logging
@test basename(file) == basename(file_logging)
bp = JuliaInterpreter.finish_stack!(frame)
@test bp isa BreakpointRef
frame = leaf(frame)
Expand Down
Loading