Julia: Infinite goto loop returns an integer

Created on 11 Sep 2019  路  5Comments  路  Source: JuliaLang/julia

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
bug lowering

Most helpful comment

(It seems to have been lowered to 1)

All 5 comments

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:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yurivish picture yurivish  路  3Comments

Keno picture Keno  路  3Comments

iamed2 picture iamed2  路  3Comments

TotalVerb picture TotalVerb  路  3Comments

ararslan picture ararslan  路  3Comments