Skip to content

Commit 6701a16

Browse files
committed
PEMap: initial capacity bounds check
1 parent b8ed041 commit 6701a16

File tree

1 file changed

+1
-1
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/common

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ private PEMap(int initialCapacity, boolean isSet, boolean hasSideEffect) {
146146

147147
private void init(int size) {
148148
if (size > INITIAL_CAPACITY) {
149-
entries = new Object[size << 1];
149+
entries = new Object[(size << 1) < 0 ? MAX_ELEMENT_COUNT : size << 1];
150150
}
151151
}
152152

0 commit comments

Comments
 (0)