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

Throw OverflowError when the field offset / size overflows. #11330

Merged
merged 1 commit into from
May 19, 2015

Conversation

yuyichao
Copy link
Contributor

Improve #11320.

This doesn't completely fix it but should be the right thing to do anyway.

@ScottPJones

@yuyichao
Copy link
Contributor Author

Note that the current overflow checking relies on size_t never overflow, which is true now since each increment is small enough. We do need special care if we increase the size of the size and offset field, especially on 32-bit.

@yuyichao
Copy link
Contributor Author

Test done:

yuyichao% ./julia -f -e 'Enumerate((Int, 1:10000...))'
ERROR: OverflowError()
 in process_options at ./client.jl:288
 in _start at ./client.jl:409

@yuyichao
Copy link
Contributor Author

I agree the error message is not very informative but I guess we'd better live with it before error handling/reporting is not a big issue anymore...

@ScottPJones
Copy link
Contributor

Thanks, @yuyichao... this would be nasty for a lot of the stuff I'm doing!

@yuyichao
Copy link
Contributor Author

I guess tuple is not meant to be used as a long immutable array. I can see why it is useful though...
Maybe #11242 addresses some of this?

@timholy
Copy link
Member

timholy commented May 18, 2015

#11242 doesn't address this issue.

@vtjnash
Copy link
Member

vtjnash commented May 18, 2015

lgtm

ihnorton added a commit that referenced this pull request May 19, 2015
Throw OverflowError when the field offset / size overflows.
@ihnorton ihnorton merged commit eb5da26 into JuliaLang:master May 19, 2015
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

Successfully merging this pull request may close these issues.

5 participants