Skip to content

Commit 92695b7

Browse files
committed
cast list index to index-sized integer
1 parent 3b8e221 commit 92695b7

File tree

1 file changed

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

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
import com.oracle.graal.python.nodes.function.builtins.PythonTernaryBuiltinNode;
8585
import com.oracle.graal.python.nodes.function.builtins.PythonUnaryBuiltinNode;
8686
import com.oracle.graal.python.nodes.truffle.PythonArithmeticTypes;
87+
import com.oracle.graal.python.nodes.util.CastToIndexNode;
8788
import com.oracle.graal.python.runtime.exception.PException;
8889
import com.oracle.graal.python.runtime.exception.PythonErrorType;
8990
import com.oracle.graal.python.runtime.sequence.PSequence;
@@ -366,8 +367,9 @@ protected static SetItemNode create() {
366367
@Specialization
367368
protected Object doObjectIndex(PList self, Object objectIdx, Object value,
368369
@Cached("create()") IndexNode getIndexNode,
369-
@Cached("create()") SetItemNode getRecursiveNode) {
370-
return getRecursiveNode.execute(self, getIndexNode.execute(objectIdx), value);
370+
@Cached("create()") SetItemNode getRecursiveNode,
371+
@Cached("create()") CastToIndexNode castToIndex) {
372+
return getRecursiveNode.execute(self, castToIndex.execute(getIndexNode.execute(objectIdx)), value);
371373
}
372374

373375
@SuppressWarnings("unused")

0 commit comments

Comments
 (0)