Skip to content

Commit b669ec3

Browse files
committed
StringBuiltins: do not shadow OverflowError on asSize message
1 parent 8a583b2 commit b669ec3

File tree

1 file changed

+6
-11
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/str

1 file changed

+6
-11
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/str/StringBuiltins.java

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1535,18 +1535,13 @@ String doStringObject(VirtualFrame frame, String left, Object right,
15351535
@Shared("loopProfile") @Cached("createCountingProfile()") LoopConditionProfile loopProfile,
15361536
@Shared("castToIndexNode") @CachedLibrary(limit = "getCallSiteInlineCacheMaxDepth()") PythonObjectLibrary lib,
15371537
@Cached IsBuiltinClassProfile typeErrorProfile) {
1538-
try {
1539-
int repeat;
1540-
if (hasFrame.profile(frame != null)) {
1541-
repeat = lib.asSizeWithState(right, PArguments.getThreadState(frame));
1542-
} else {
1543-
repeat = lib.asSize(right);
1544-
}
1545-
return doStringIntGeneric(left, repeat, loopProfile);
1546-
} catch (PException e) {
1547-
e.expect(PythonBuiltinClassType.OverflowError, typeErrorProfile);
1548-
throw raise(MemoryError);
1538+
int repeat;
1539+
if (hasFrame.profile(frame != null)) {
1540+
repeat = lib.asSizeWithState(right, PArguments.getThreadState(frame));
1541+
} else {
1542+
repeat = lib.asSize(right);
15491543
}
1544+
return doStringIntGeneric(left, repeat, loopProfile);
15501545
}
15511546

15521547
@Specialization

0 commit comments

Comments
 (0)