Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Evgeny Mandrikov
asm
Commits
cf20d046
Commit
cf20d046
authored
Aug 28, 2021
by
Eric Bruneton
Browse files
Add an assertion in ByteVector.enlarge().
parent
e45e0a04
Changes
1
Hide whitespace changes
Inline
Side-by-side
asm/src/main/java/org/objectweb/asm/ByteVector.java
View file @
cf20d046
...
...
@@ -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
];
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment