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

setfault overloading Base.int incorrectly #4928

Closed
WestleyArgentum opened this issue Nov 26, 2013 · 3 comments
Closed

setfault overloading Base.int incorrectly #4928

WestleyArgentum opened this issue Nov 26, 2013 · 3 comments
Labels
status:won't change Indicates that work won't continue on an issue or pull request

Comments

@WestleyArgentum
Copy link
Member

I'll build a newer version and test again soon, but I have to run for now

               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" to list help topics
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.2.0+3 (2013-11-19 21:30 UTC)
 _/ |\__'_|_|_|\__'_|  |  release-0.2/09be0a1 (fork: 3 commits, 3 days)
|__/                   |  x86_64-apple-darwin13.0.0


julia> import Base.int

julia> int(d) = 64
Warning: Method definition int(Any,) in module Base at base.jl:72 overwritten in module Main at none:1.
int (generic function with 11 methods)

julia> djdjd
Segmentation fault: 11
julia> Base.versioninfo()
Julia Version 0.2.0+3
Commit 09be0a1 (2013-11-19 21:30 UTC)
Platform Info:
  System: Darwin (x86_64-apple-darwin13.0.0)
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY)
  LAPACK: libopenblas
  LIBM: libopenlibm
@Keno
Copy link
Member

Keno commented Nov 26, 2013

I'm gonna go with "Don't do that". There's absolutely no way to guarantee correct execution if conversion to integer gives wrong results.

@Keno Keno closed this as completed Nov 26, 2013
@StefanKarpinski
Copy link
Sponsor Member

Yeah, this is like doing #define 2 3 at the top of a C program and complaining that it doesn't work right. In theory, we shouldn't segfault, but I'm not sure if that's even reasonable.

@JeffBezanson
Copy link
Sponsor Member

This is probably related to #265, but given that int will be used for things like indexes passed to native code, it's quite possible that there's no way to avoid segfaulting with this definition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:won't change Indicates that work won't continue on an issue or pull request
Projects
None yet
Development

No branches or pull requests

4 participants