Skip to content

Commit 27a44dc

Browse files
committed
Catching ArithmeticException in List.iMul node.
1 parent 7f136c8 commit 27a44dc

File tree

1 file changed

+8
-0
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/list

1 file changed

+8
-0
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/list/ListBuiltins.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,6 +1264,8 @@ PList doIntInt(PList list, int right) {
12641264
return list;
12651265
} catch (OutOfMemoryError e) {
12661266
throw raise(MemoryError);
1267+
} catch (ArithmeticException e) {
1268+
throw raise(OverflowError, MulNode.CANNOT_FIT_MESSAGE);
12671269
}
12681270
}
12691271

@@ -1305,6 +1307,8 @@ PList doLongInt(PList list, int right) {
13051307
return list;
13061308
} catch (OutOfMemoryError e) {
13071309
throw raise(MemoryError);
1310+
} catch (ArithmeticException e) {
1311+
throw raise(OverflowError, MulNode.CANNOT_FIT_MESSAGE);
13081312
}
13091313
}
13101314

@@ -1346,6 +1350,8 @@ PList doDoubleInt(PList list, int right) {
13461350
return list;
13471351
} catch (OutOfMemoryError e) {
13481352
throw raise(MemoryError);
1353+
} catch (ArithmeticException e) {
1354+
throw raise(OverflowError, MulNode.CANNOT_FIT_MESSAGE);
13491355
}
13501356
}
13511357

@@ -1387,6 +1393,8 @@ PList doObjectInt(PList list, int right) {
13871393
return list;
13881394
} catch (OutOfMemoryError e) {
13891395
throw raise(MemoryError);
1396+
} catch (ArithmeticException e) {
1397+
throw raise(OverflowError, MulNode.CANNOT_FIT_MESSAGE);
13901398
}
13911399
}
13921400

0 commit comments

Comments
 (0)