Skip to content

Commit c0e6522

Browse files
committed
Support 'PInt' in 'SSN.SetScalarItemNode'.
1 parent f0472b0 commit c0e6522

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/common/SequenceStorageNodes.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,10 +543,32 @@ protected void doInt(IntSequenceStorage storage, int idx, int value) {
543543
storage.setIntItemNormalized(idx, value);
544544
}
545545

546+
@Specialization
547+
protected void doInt(IntSequenceStorage storage, int idx, PInt value) {
548+
try {
549+
storage.setIntItemNormalized(idx, value.intValueExact());
550+
} catch (ArithmeticException e) {
551+
// TODO implement store generalization
552+
CompilerDirectives.transferToInterpreter();
553+
throw new UnsupportedOperationException();
554+
}
555+
}
556+
546557
protected void doLong(LongSequenceStorage storage, int idx, long value) {
547558
storage.setLongItemNormalized(idx, value);
548559
}
549560

561+
@Specialization
562+
protected void doLong(LongSequenceStorage storage, int idx, PInt value) {
563+
try {
564+
storage.setLongItemNormalized(idx, value.longValueExact());
565+
} catch (ArithmeticException e) {
566+
// TODO implement store generalization
567+
CompilerDirectives.transferToInterpreter();
568+
throw new UnsupportedOperationException();
569+
}
570+
}
571+
550572
@Specialization
551573
protected void doDouble(DoubleSequenceStorage storage, int idx, double value) {
552574
storage.setDoubleItemNormalized(idx, value);

0 commit comments

Comments
 (0)