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
Tobias Gruetzmacher
asm
Commits
390a3ba5
Commit
390a3ba5
authored
Mar 20, 2011
by
ebruneton
Browse files
fixed "bug" #315882
parent
54db4288
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/org/objectweb/asm/ClassWriter.java
View file @
390a3ba5
...
...
@@ -714,6 +714,9 @@ public class ClassWriter implements ClassVisitor {
* @return the bytecode of the class that was build with this class writer.
*/
public
byte
[]
toByteArray
()
{
if
(
index
>
Short
.
MAX_VALUE
)
{
throw
new
RuntimeException
(
"Class file too large!"
);
}
// computes the real size of the bytecode of this class
int
size
=
24
+
2
*
interfaceCount
;
int
nbFields
=
0
;
...
...
@@ -1110,8 +1113,8 @@ public class ClassWriter implements ClassVisitor {
if
(
result
==
null
)
{
pool
.
putByte
(
LONG
).
putLong
(
value
);
result
=
new
Item
(
index
,
key
);
put
(
result
);
index
+=
2
;
put
(
result
);
}
return
result
;
}
...
...
@@ -1129,8 +1132,8 @@ public class ClassWriter implements ClassVisitor {
if
(
result
==
null
)
{
pool
.
putByte
(
DOUBLE
).
putLong
(
key
.
longVal
);
result
=
new
Item
(
index
,
key
);
put
(
result
);
index
+=
2
;
put
(
result
);
}
return
result
;
}
...
...
@@ -1334,7 +1337,7 @@ public class ClassWriter implements ClassVisitor {
* @param i the item to be added to the constant pool's hash table.
*/
private
void
put
(
final
Item
i
)
{
if
(
index
>
threshold
)
{
if
(
index
+
typeCount
>
threshold
)
{
int
ll
=
items
.
length
;
int
nl
=
ll
*
2
+
1
;
Item
[]
newItems
=
new
Item
[
nl
];
...
...
src/org/objectweb/asm/MethodWriter.java
View file @
390a3ba5
...
...
@@ -1784,6 +1784,9 @@ class MethodWriter implements MethodVisitor {
}
int
size
=
8
;
if
(
code
.
length
>
0
)
{
if
(
code
.
length
>
65536
)
{
throw
new
RuntimeException
(
"Method code too large!"
);
}
cw
.
newUTF8
(
"Code"
);
size
+=
18
+
code
.
length
+
8
*
handlerCount
;
if
(
localVar
!=
null
)
{
...
...
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