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

fixed_ints: Int32 division crash on overflow with niti #2430

Open
PatrickBlanchette opened this issue May 9, 2017 · 4 comments
Open

fixed_ints: Int32 division crash on overflow with niti #2430

PatrickBlanchette opened this issue May 9, 2017 · 4 comments

Comments

@PatrickBlanchette
Copy link
Contributor

I got an intern crash on that classic test for overflow.

print( (-2147483647i32 - 1i32) / -1i32 )

@privat
Copy link
Member

privat commented May 9, 2017

@R4PaSs ideas?

@lbajolet
Copy link
Contributor

lbajolet commented May 9, 2017

This is strange, I don't have a crash when compiling or executing the program.

$ nitc test.nit
$ ./test
-2147483648

nitc version: v0.8-1978-g117eb1e

system: 4.4.0-75-generic #96-Ubuntu SMP Thu Apr 20 09:56:33 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

@PatrickBlanchette
Copy link
Contributor Author

Try with

$ nit test.nit

It crash for me but it's true that it don't crash if you use

$ nitc test.nit
$ ./test

@PatrickBlanchette PatrickBlanchette changed the title fixed_ints: Int32 division crash on overflow fixed_ints: Int32 division crash on overflow with niti May 10, 2017
@ghost
Copy link

ghost commented Nov 12, 2017

same here, exception with nit test.nit and no exception for compiled code. Linux 32 bit.

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

3 participants