Skip to content

Commit 1024848

Browse files
authored
Merge pull request #629 from JuliaDebug/avi/54678
adjustments to v1.11
2 parents eae3b4c + 5700dcc commit 1024848

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

src/interpret.jl

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -372,17 +372,14 @@ function do_assignment!(frame, @nospecialize(lhs), @nospecialize(rhs))
372372
counter = (frame.assignment_counter += 1)
373373
data.locals[lhs.id] = Some{Any}(rhs)
374374
data.last_reference[lhs.id] = counter
375-
elseif isa(lhs, GlobalRef)
375+
elseif isa(lhs, Symbol) || isa(lhs, GlobalRef)
376+
mod = lhs isa Symbol ? moduleof(frame) : lhs.mod
377+
name = lhs isa Symbol ? lhs : lhs.name
378+
Core.eval(mod, Expr(:global, name))
376379
@static if @isdefined setglobal!
377-
setglobal!(lhs.mod, lhs.name, rhs)
380+
setglobal!(mod, name, rhs)
378381
else
379-
ccall(:jl_set_global, Cvoid, (Any, Any, Any), lhs.mod, lhs.name, rhs)
380-
end
381-
elseif isa(lhs, Symbol)
382-
@static if @isdefined setglobal!
383-
setglobal!(moduleof(code), lhs, rhs)
384-
else
385-
ccall(:jl_set_global, Cvoid, (Any, Any, Any), moduleof(code), lhs, rhs)
382+
ccall(:jl_set_global, Cvoid, (Any, Any, Any), mod, name, rhs)
386383
end
387384
end
388385
end

test/breakpoints.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ end
520520
return 2
521521
end
522522
frame = JuliaInterpreter.enter_call(f_macro)
523-
file_logging = "logging.jl"
523+
file_logging = String(only(methods(var"@info")).file)
524524
line_logging = 0
525525
for entry in frame.framecode.src.linetable
526526
if entry.file === Symbol(file_logging)
@@ -534,7 +534,7 @@ end
534534
@test bp isa BreakpointRef
535535
file, ln = JuliaInterpreter.whereis(frame)
536536
@test ln == line_logging
537-
@test basename(file) == file_logging
537+
@test basename(file) == basename(file_logging)
538538
bp = JuliaInterpreter.finish_stack!(frame)
539539
@test bp isa BreakpointRef
540540
frame = leaf(frame)

0 commit comments

Comments
 (0)