8155259: Suspicious buffer allocation in com.sun.tools.javac.file.BaseFileManager

8172106: javac throws exception when compiling source file of size 1.5G

Reviewed-by: vromero
This commit is contained in:
Archie L. Cobbs 2023-01-04 16:01:59 +00:00 committed by Vicente Romero
parent 4c0f24ef71
commit 6a07fd0ec1

View File

@ -432,7 +432,7 @@ public abstract class BaseFileManager implements JavaFileManager {
ByteBuffer result = ByteBuffer result =
(cached != null && cached.capacity() >= capacity) (cached != null && cached.capacity() >= capacity)
? cached.clear() ? cached.clear()
: ByteBuffer.allocate(capacity + capacity>>1); : ByteBuffer.allocate(capacity);
cached = null; cached = null;
return result; return result;
} }