diff options
author | Eric Bruneton <ebruneton@free.fr> | 2021-08-28 11:55:18 +0200 |
---|---|---|
committer | Eric Bruneton <ebruneton@free.fr> | 2021-08-28 11:55:18 +0200 |
commit | cf20d046cab42e80866d8557e1b4ba4d47186300 (patch) | |
tree | 00c28699e50a5fb53a747aafb44d42fcda6ac573 /asm/src | |
parent | e45e0a04752e48d306a1b824d6367c6392ba6187 (diff) | |
download | ow2-asm-cf20d046cab42e80866d8557e1b4ba4d47186300.tar.gz |
Add an assertion in ByteVector.enlarge().
Diffstat (limited to 'asm/src')
-rw-r--r-- | asm/src/main/java/org/objectweb/asm/ByteVector.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/asm/src/main/java/org/objectweb/asm/ByteVector.java b/asm/src/main/java/org/objectweb/asm/ByteVector.java index 9db89566..d728a15e 100644 --- a/asm/src/main/java/org/objectweb/asm/ByteVector.java +++ b/asm/src/main/java/org/objectweb/asm/ByteVector.java @@ -352,6 +352,9 @@ public class ByteVector { * @param size number of additional bytes that this byte vector should be able to receive. */ private void enlarge(final int size) { + if (length > data.length) { + throw new AssertionError("Internal error"); + } int doubleCapacity = 2 * data.length; int minimalCapacity = length + size; byte[] newData = new byte[doubleCapacity > minimalCapacity ? doubleCapacity : minimalCapacity]; |