Skip to content

Commit 9d07625

Browse files
committed
Adding @child annotation and correcting creating CastToIndexNode.
1 parent 49fe912 commit 9d07625

File tree

1 file changed

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

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,11 +1669,12 @@ public String doTitle(String self) {
16691669
@TypeSystemReference(PythonArithmeticTypes.class)
16701670
abstract static class CenterNode extends PythonBuiltinNode {
16711671

1672-
protected CastToIndexNode toIndexNode;
1672+
private @Child CastToIndexNode toIndexNode;
16731673

16741674
private CastToIndexNode getCastToIndexNode() {
16751675
if (toIndexNode == null) {
1676-
toIndexNode = CastToIndexNode.createOverflow();
1676+
CompilerDirectives.transferToInterpreterAndInvalidate();
1677+
toIndexNode = insert(CastToIndexNode.createOverflow());
16771678
}
16781679
return toIndexNode;
16791680
}

0 commit comments

Comments
 (0)