File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -362,7 +362,14 @@ func (ac *arrayContainer) iorArray(value2 *arrayContainer) container {
362362 if maxPossibleCardinality > cap (value1 .content ) {
363363 // doubling the capacity reduces new slice allocations in the case of
364364 // repeated calls to iorArray().
365- newcontent := make ([]uint16 , 0 , 2 * maxPossibleCardinality )
365+ newSize := 2 * maxPossibleCardinality
366+ // the second check is to handle overly large array containers
367+ // and should not occur in normal usage,
368+ // as all array containers should be at most arrayDefaultMaxSize
369+ if newSize > 8192 && maxPossibleCardinality <= 8192 {
370+ newSize = 8192
371+ }
372+ newcontent := make ([]uint16 , 0 , newSize )
366373 copy (newcontent [len2 :maxPossibleCardinality ], ac .content [0 :len1 ])
367374 ac .content = newcontent
368375 } else {
You can’t perform that action at this time.
0 commit comments