Catch correct exception type in MultiplicationNode (#1652)
Closes #1651
This commit is contained in:
1 parent
41e012a0f0
commit
01f8fcae7b
3 files changed
+43
-33
No files matched your search
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||
* Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -31,7 +31,7 @@ public abstract class MultiplicationNode extends BinaryExpressionNode {
|
||||
protected long eval(long left, long right) {
|
||||
try {
|
||||
return StrictMath.multiplyExact(left, right);
|
||||
} catch (VmException e) {
|
||||
} catch (ArithmeticException e) {
|
||||
CompilerDirectives.transferToInterpreter();
|
||||
throw exceptionBuilder().evalError("integerOverflow").build();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user