Skip to content
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

Logging macros break the interpreter #441

Closed
simonbyrne opened this issue Nov 20, 2020 · 2 comments · Fixed by #442
Closed

Logging macros break the interpreter #441

simonbyrne opened this issue Nov 20, 2020 · 2 comments · Fixed by #442

Comments

@simonbyrne
Copy link

simonbyrne commented Nov 20, 2020

On Julia 1.5 with JuliaInterpreter 0.8.3:

julia> using JuliaInterpreter

julia> foo() = @info "hello"
foo (generic function with 1 method)

julia> @interpret foo()
ERROR: UndefVarError: REPL[2] not defined
Stacktrace:
 [1] collect_args(::Frame, ::Expr; isfc::Bool) at /Users/simon/.julia/packages/JuliaInterpreter/kDn3E/src/interpret.jl:60
 [2] collect_args at /Users/simon/.julia/packages/JuliaInterpreter/kDn3E/src/interpret.jl:134 [inlined]
 [3] evaluate_call_recurse!(::Any, ::Frame, ::Expr; enter_generated::Bool) at /Users/simon/.julia/packages/JuliaInterpreter/kDn3E/src/interpret.jl:207
 [4] evaluate_call_recurse! at /Users/simon/.julia/packages/JuliaInterpreter/kDn3E/src/interpret.jl:201 [inlined]
 [5] eval_rhs(::Any, ::Frame, ::Expr) at /Users/simon/.julia/packages/JuliaInterpreter/kDn3E/src/interpret.jl:388
 [6] step_expr!(::Any, ::Frame, ::Any, ::Bool) at /Users/simon/.julia/packages/JuliaInterpreter/kDn3E/src/interpret.jl:531
 [7] step_expr!(::Any, ::Frame, ::Bool) at /Users/simon/.julia/packages/JuliaInterpreter/kDn3E/src/interpret.jl:581
 [8] finish!(::Any, ::Frame, ::Bool) at /Users/simon/.julia/packages/JuliaInterpreter/kDn3E/src/commands.jl:14
 [9] finish_and_return! at /Users/simon/.julia/packages/JuliaInterpreter/kDn3E/src/commands.jl:29 [inlined]
 [10] evaluate_call_recurse!(::Any, ::Frame, ::Expr; enter_generated::Bool) at /Users/simon/.julia/packages/JuliaInterpreter/kDn3E/src/interpret.jl:239
 [11] evaluate_call_recurse! at /Users/simon/.julia/packages/JuliaInterpreter/kDn3E/src/interpret.jl:201 [inlined]
 [12] eval_rhs(::Any, ::Frame, ::Expr) at /Users/simon/.julia/packages/JuliaInterpreter/kDn3E/src/interpret.jl:388
 [13] step_expr!(::Any, ::Frame, ::Any, ::Bool) at /Users/simon/.julia/packages/JuliaInterpreter/kDn3E/src/interpret.jl:531
 [14] step_expr!(::Any, ::Frame, ::Bool) at /Users/simon/.julia/packages/JuliaInterpreter/kDn3E/src/interpret.jl:581
 [15] finish!(::Any, ::Frame, ::Bool) at /Users/simon/.julia/packages/JuliaInterpreter/kDn3E/src/commands.jl:14
 [16] finish_and_return! at /Users/simon/.julia/packages/JuliaInterpreter/kDn3E/src/commands.jl:29 [inlined]
 [17] finish_and_return! at /Users/simon/.julia/packages/JuliaInterpreter/kDn3E/src/commands.jl:33 [inlined] (repeats 2 times)
 [18] top-level scope at /Users/simon/.julia/packages/JuliaInterpreter/kDn3E/src/construct.jl:762

Downstream issue JuliaDebug/Debugger.jl#276

@fredrikekre
Copy link
Contributor

fredrikekre commented Nov 20, 2020

#440 fixes this I think.

@simonbyrne
Copy link
Author

It looks like it, thanks!

timholy added a commit that referenced this issue Nov 21, 2020
`evaluate_call_recurse!` calls `maybe_evaluate_builtin`, and if
that doesn't return a `Some{Any}`, it uses the output as the
new `call_expr`. The next thing it does is look up the args.
Consequently, to avoid double-lookup, our expansion of `invoke` should
return the non-looked-up arguments.

Fixes #441
Closes #440
timholy added a commit that referenced this issue Nov 21, 2020
`evaluate_call_recurse!` calls `maybe_evaluate_builtin`, and if
that doesn't return a `Some{Any}`, it uses the output as the
new `call_expr`. The next thing it does is look up the args.
Consequently, to avoid double-lookup, our expansion of `invoke` should
return the non-looked-up arguments.

Fixes #441
Closes #440
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants