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
0b66c85a
Commit
0b66c85a
authored
Jun 15, 2018
by
Eric Bruneton
Browse files
Merge branch 'trask/asm-fix-verify-error-operand-stack-overflow'
parents
2a3003cf
e10e36d2
Changes
2
Hide whitespace changes
Inline
Side-by-side
asm/src/main/java/org/objectweb/asm/MethodWriter.java
View file @
0b66c85a
...
...
@@ -854,7 +854,12 @@ final class MethodWriter extends MethodVisitor {
if
(
compute
==
COMPUTE_MAX_STACK_AND_LOCAL_FROM_FRAMES
)
{
relativeStackSize
=
nStack
;
if
(
nStack
>
maxRelativeStackSize
)
{
for
(
int
i
=
0
;
i
<
nStack
;
++
i
)
{
if
(
stack
[
i
]
==
Opcodes
.
LONG
||
stack
[
i
]
==
Opcodes
.
DOUBLE
)
{
relativeStackSize
++;
}
}
if
(
relativeStackSize
>
maxRelativeStackSize
)
{
maxRelativeStackSize
=
relativeStackSize
;
}
}
...
...
asm/src/test/java/org/objectweb/asm/ClassWriterComputeMaxsTest.java
View file @
0b66c85a
...
...
@@ -1128,4 +1128,19 @@ public class ClassWriterComputeMaxsTest {
assertMaxs
(
1
,
1
);
}
@Test
public
void
testComputeMaxsFromFrameWithLong
()
{
init
(
Opcodes
.
V1_7
);
Label
l0
=
new
Label
();
methodVisitor
.
visitMethodInsn
(
Opcodes
.
INVOKESTATIC
,
"ABC"
,
"get"
,
"()J"
,
false
);
GOTO
(
l0
);
LABEL
(
l0
);
methodVisitor
.
visitFrame
(
Opcodes
.
F_NEW
,
0
,
null
,
1
,
new
Object
[]
{
Opcodes
.
LONG
});
ACONST_NULL
();
RETURN
();
assertMaxs
(
3
,
1
);
}
}
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