Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jamie Mansfield
asm
Commits
23a10efb
Commit
23a10efb
authored
Jun 16, 2018
by
Eric Bruneton
Browse files
Fix the issue, make the previously added test pass.
parent
2a673125
Changes
3
Hide whitespace changes
Inline
Side-by-side
asm/src/main/java/org/objectweb/asm/ClassReader.java
View file @
23a10efb
...
...
@@ -1132,6 +1132,7 @@ public class ClassReader {
currentOffset
-
methodInfoOffset
,
synthetic
,
(
context
.
currentMethodAccessFlags
&
Opcodes
.
ACC_DEPRECATED
)
!=
0
,
readUnsignedShort
(
methodInfoOffset
+
4
),
signatureIndex
,
exceptionsOffset
))
{
return
currentOffset
;
...
...
asm/src/main/java/org/objectweb/asm/MethodWriter.java
View file @
23a10efb
...
...
@@ -2003,6 +2003,8 @@ final class MethodWriter extends MethodVisitor {
* of this method might be copied contains a Synthetic attribute.
* @param hasDeprecatedAttribute whether the method_info JVMS structure from which the attributes
* of this method might be copied contains a Deprecated attribute.
* @param descriptorIndex the descriptor_index field of the method_info JVMS structure from which
* the attributes of this method might be copied.
* @param signatureIndex the constant pool index contained in the Signature attribute of the
* method_info JVMS structure from which the attributes of this method might be copied, or 0.
* @param exceptionsOffset the offset in 'source.b' of the Exceptions attribute of the method_info
...
...
@@ -2017,9 +2019,16 @@ final class MethodWriter extends MethodVisitor {
final
int
methodInfoLength
,
final
boolean
hasSyntheticAttribute
,
final
boolean
hasDeprecatedAttribute
,
final
int
descriptorIndex
,
final
int
signatureIndex
,
final
int
exceptionsOffset
)
{
// If the method descriptor has changed, with more locals than the max_locals field of the
// original Code attribute, if any, then the original method attributes can't be copied. A
// conservative check on the descriptor changes alone ensures this (being more precise is not
// worth the additional complexity, because these cases should be rare -- if a transform changes
// a method descriptor, most of the time it needs to change the method's code too).
if
(
source
!=
symbolTable
.
getSource
()
||
descriptorIndex
!=
this
.
descriptorIndex
||
signatureIndex
!=
this
.
signatureIndex
||
hasDeprecatedAttribute
!=
((
accessFlags
&
Opcodes
.
ACC_DEPRECATED
)
!=
0
))
{
return
false
;
...
...
asm/src/test/java/org/objectweb/asm/ClassVisitorTest.java
View file @
23a10efb
...
...
@@ -32,7 +32,6 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
org.junit.jupiter.api.Test
;
import
org.junit.jupiter.params.ParameterizedTest
;
import
org.junit.jupiter.params.provider.CsvSource
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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