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

Incorrect code generation when inlining is off #10134

Closed
mbauman opened this issue Feb 8, 2015 · 2 comments
Closed

Incorrect code generation when inlining is off #10134

mbauman opened this issue Feb 8, 2015 · 2 comments

Comments

@mbauman
Copy link
Sponsor Member

mbauman commented Feb 8, 2015

I don't know how to better describe (or search) for this:

$ julia-0.4 --inline=no
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.4.0-dev+3216 (2015-02-08 17:14 UTC)
 _/ |\__'_|_|_|\__'_|  |  Commit 470cacb* (0 days old master)
|__/                   |  x86_64-apple-darwin13.4.0

julia> type Foo{N}
         t::NTuple{N,Int}
       end

julia> f(x) = !isempty(x.t) && x.t[1]
f (generic function with 1 method)

julia> f(Foo(()))
ERROR: BoundsError: attempt to access ()
  at index [1]
 in getindex at /Users/mbauman/Code/julia-0.4/usr/lib/julia/sys.dylib
 in f at none:1
 in eval at no file

The call f(Foo(())) properly returns false when inlining is enabled.

@simonster
Copy link
Member

maybe a dup of #9536

@mbauman
Copy link
Sponsor Member Author

mbauman commented Feb 8, 2015

Ah, yup, seems to be. Isaiah's speculative fixes-9536-but-breaks-other-things patch in #9536 (comment) fixes this. Thanks Simon.

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

No branches or pull requests

2 participants