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

BoundsError in zero length map with "--inline=no" set. #9722

Closed
MichaelHatherly opened this issue Jan 11, 2015 · 2 comments
Closed

BoundsError in zero length map with "--inline=no" set. #9722

MichaelHatherly opened this issue Jan 11, 2015 · 2 comments

Comments

@MichaelHatherly
Copy link
Member

The following sequence reliably produces a BoundsError on current master for me:

$ 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+2607 (2015-01-11 06:43 UTC)
 _/ |\__'_|_|_|\__'_|  |  Commit 02c0501 (0 days old master)
|__/                   |  x86_64-unknown-linux-gnu

julia> f(args...) = map(a -> a, args)
f (generic function with 1 method)

julia> f()
ERROR: BoundsError: attempt to access ()
  at index [1]
 in f at none:1
 in eval at no file

When --inline is not passed then f() returns () as expected. This does not affect 0.3-release as far as I can see since there is no --inline=no flag.

Declaring the function with @noinline does not produce the error:

julia> @noinline f(args...) = map(a -> a, args)
f (generic function with 1 method)

julia> f()
()

This error breaks @which when it is passed a zero argument method call since Base.typesof uses map is a similar manner to f in the example provided here.

@timholy
Copy link
Member

timholy commented Jan 11, 2015

Seems likely to be the same bug as #9536, but this is a more direct way to trigger it.

@MichaelHatherly
Copy link
Member Author

Closed as dup of #9536.

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