In the REPL, the following returns 1 instead of looping forever:
julia> (@label a; @goto a)
1
Observed on Julia 1.2:
julia> versioninfo()
Julia Version 1.2.0-rc3.0
Commit f18655ed3c (2019-08-12 20:32 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.1 (ORCJIT, sandybridge)
Environment:
JULIA_NUM_THREADS = 4
Infinite loops without side effects are considered undefined behavior in LLVM and we inherit that assumption.
(Though this might be an issue with the interpreter instead, since that may not have been compiled).
(It seems to have been lowered to 1)
:sweat_smile:
I assume the bug is that it should return 42 instead? :stuck_out_tongue:
Most helpful comment
(It seems to have been lowered to
1)