Skip to content

Commit 8b8d6b2

Browse files
committed
Add missing TruffleBoundary
1 parent b30d46e commit 8b8d6b2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/BuiltinFunctions.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1603,6 +1603,11 @@ public abstract static class AsciiNode extends PythonUnaryBuiltinNode {
16031603
public Object asciiString(Object obj,
16041604
@Cached CastToJavaStringNode castToJavaStringNode) {
16051605
String str = castToJavaStringNode.execute(obj);
1606+
return doAsciiString(str);
1607+
}
1608+
1609+
@TruffleBoundary
1610+
private static Object doAsciiString(String str) {
16061611
byte[] bytes = BytesUtils.unicodeEscape(str);
16071612
boolean hasSingleQuote = false;
16081613
boolean hasDoubleQuote = false;
@@ -1632,6 +1637,11 @@ public Object asciiGeneric(VirtualFrame frame, Object obj,
16321637
@Cached ReprNode reprNode) {
16331638
String repr = (String) reprNode.execute(frame, obj);
16341639
byte[] bytes = BytesUtils.unicodeEscape(repr);
1640+
return newString(bytes);
1641+
}
1642+
1643+
@TruffleBoundary
1644+
private static String newString(byte[] bytes) {
16351645
return new String(bytes);
16361646
}
16371647
}

0 commit comments

Comments
 (0)