-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong proto offset of invoke-polymorphic #538
Comments
I think it should actually be + 6, shouldn't it?
|
Oh sorry, it is +6. BTW, not sure if this kind of proto will intern into protoSection normally. Just try below rough workaround to prevent exception:
At ClassPool private void internCode(@Nonnull Method method) {
// ...
case ReferenceType.METHOD:
+ if (instruction.getOpcode().format == Format.Format45cc) {
+ dexPool.protoSection.intern((MethodProtoReference)
+ ((Instruction45cc)instruction).getReference2());
+ }
dexPool.methodSection.intern((MethodReference)reference);
break; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For exmaple "FA30 800F 3004 B503" (from O emulator core-oj.jar)
offset 2: method @0F80(3968) = java.lang.Object java.lang.invoke.MethodHandle.invoke(java.lang.Object[])
offset 4: proto @03B5(949) = java.lang.Object (java.lang.invoke.MethodHandle, java.lang.Object[])
The offset 3 reads 300F=12303 then results:
#Proto index out of bounds: 12303
#invoke-polymorphic {v0, p0, p1}, Ljava/lang/invoke/MethodHandle;->invoke([Ljava/lang/Object;)Ljava/lang/Object;, method_proto@12303
It should fix by: (DexBackedInstruction45cc)
The text was updated successfully, but these errors were encountered: