summaryrefslogtreecommitdiff
path: root/asm/src
diff options
context:
space:
mode:
Diffstat (limited to 'asm/src')
-rw-r--r--asm/src/main/java/org/objectweb/asm/ByteVector.java3
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];