Skip to content

Commit

Permalink
[Truffle] int * int always fits an int.
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon committed Jan 8, 2015
1 parent e1dbdcd commit db80ada
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ public int mul(int a, int b) {
}

@Specialization
public Object mulWithOverflow(int a, int b) {
return fixnumOrBignum(bignum(a).multiply(bignum(b)));
public long mulWithOverflow(int a, int b) {
return (long) a * (long) b;
}

@Specialization(rewriteOn = ArithmeticException.class)
Expand Down

2 comments on commit db80ada

@nirvdrum
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bad commit message, I think. You threw me off :-)

@eregon
Copy link
Member Author

@eregon eregon commented on db80ada Jan 8, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, sorry. I guessed I said/wrote it too much.

Please sign in to comment.