Skip to content

Commit 3952701

Browse files
committed
PartialBuiltins: missing getter guard
report loop count: check for overflow
1 parent 67b0ae6 commit 3952701

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ Object doReduce(VirtualFrame frame, Object function, Object sequence, Object ini
144144
break;
145145
}
146146
}
147-
reportLoopCount(this, count);
147+
reportLoopCount(this, count >= 0 ? count : Integer.MAX_VALUE);
148148

149149
if (result == null) {
150150
throw raise(PythonBuiltinClassType.TypeError, REDUCE_EMPTY_SEQ);

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/partial/PartialBuiltins.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ Object doGet(PPartial self) {
143143
@GenerateNodeFactory
144144
@ImportStatic(PGuards.class)
145145
public abstract static class PartialDictNode extends PythonBinaryBuiltinNode {
146-
@Specialization
146+
@Specialization(guards = "isNoValue(mapping)")
147147
protected Object getDict(PPartial self, @SuppressWarnings("unused") PNone mapping,
148148
@Cached GetOrCreateDictNode getDict) {
149149
return getDict.execute(self);

0 commit comments

Comments
 (0)