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

(2 ^ 62) - 1 returns -1 on LLVM back-end #1239

Closed
cgay opened this issue May 21, 2019 · 2 comments
Closed

(2 ^ 62) - 1 returns -1 on LLVM back-end #1239

cgay opened this issue May 21, 2019 · 2 comments

Comments

@cgay
Copy link
Member

cgay commented May 21, 2019

format-out("%d", (2 ^ 61) - 1) gets an overflow error, as expected.

$ _build/bin/hello
Integer overflow: The result of the last operation is too large for this integer representation.
Backtrace:
  invoke-debugger:internal:dylan##1 + 0x29
  default-handler:dylan:dylan##1 + 0x12
  default-last-handler:common-dylan-internals:common-dylan##0 + 0x2e6
  signal:dylan:dylan##0 + 0x120
  error:dylan:dylan##0 + 0xb1
  -:dylan:dylan##1 + 0x16
  _Init_hello__X_hello_for_system + 0x6a
  _init + 0x151
  __libc_start_main + 0xf1
  _init + 0x62

format-out("%d", (2 ^ 62) - 1) prints -1.

$ _build/bin/hello
-1
@housel
Copy link
Member

housel commented Sep 27, 2019

Fixed in PR#1256.

@housel housel closed this as completed Sep 27, 2019
@pedro-w
Copy link
Contributor

pedro-w commented Oct 2, 2019

There is a compiler error when using the C back end, which I think was introduced by the regression test for this bug.

Cc /opendylan/_build/Bootstrap.3/build/libraries-test-suite-app/../libraries-test-suite/../common-dylan-test-suite/regressions.o : /opendylan/_build/Bootstrap.3/build/libraries-test-suite-app/../libraries-test-suite/../common-dylan-test-suite/regressions.c
:931:22: error: integer literal is too large to be represented in any integer type
  T0 = (dylan_value) 0xFFFFFFFFFFFFFFFF8000000000000001L;
                     ^
/opendylan/_build/Bootstrap.3/build/libraries-test-suite-app/../libraries-test-suite/../common-dylan-test-suite/regressions.c:932:31: error: integer literal is too large to be represented in any integer type
  MV_SET_ELT(0, (dylan_value) 0xFFFFFFFFFFFFFFFF8000000000000001L);
                              ^
2 errors generated.

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