Skip to content

Commit

Permalink
move assert above
Browse files Browse the repository at this point in the history
  • Loading branch information
aviatesk committed Nov 29, 2023
1 parent 9f74379 commit 354d182
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/toplevel/virtualprocess.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1038,6 +1038,7 @@ Partially interprets statements in `src` using JuliaInterpreter.jl:
"""
function partially_interpret!(interp::ConcreteInterpreter, mod::Module, src::CodeInfo)
concretize = select_statements(src)
@assert length(src.code) == length(concretize)

with_toplevel_logger(interp.config; filter=(JET_LOGGER_LEVEL_DEBUG)) do @nospecialize(io)
line, file = interp.lnn.line, interp.lnn.file
Expand All @@ -1048,7 +1049,6 @@ function partially_interpret!(interp::ConcreteInterpreter, mod::Module, src::Cod
# NOTE if `JuliaInterpreter.optimize!` may modify `src`, `src` and `concretize` can be inconsistent
# here we create `JuliaInterpreter.Frame` by ourselves disabling the optimization (#277)
frame = Frame(mod, src; optimize=false)
@assert length(frame.framecode.src.code) == length(concretize)
selective_eval_fromstart!(interp, frame, concretize, #=istoplevel=#true)

return concretize
Expand Down

0 comments on commit 354d182

Please sign in to comment.