-
Notifications
You must be signed in to change notification settings - Fork 54
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
[class-parse] Local variable mismatch issue #788
Comments
As discussed here, these messages are not responsible for the Then we hit (new!) issue #789, wherein "bringing it back" is annoying, along with "issue #789 part b", wherein types with These They will not prevent types or methods from being bound. (Which is not to say I won't fix it; I will. See also 4b266fa, which is the same-but-different.) |
Doh! I didn't realize they were just debug messages and didn't actually prevent stuff from getting emitted. I would have dug deeper if I had noticed that they were present in the |
I don't think it's worth fixing this issue, as I think it's actually a Kotlin compiler "bug". But first! The Consequently, I suspect that when developers use an updated What's the cause of the bug? Consider classes.zip, and our old favorite
This method is weird, which is why First, the JNI method signature:
The method signature contains the parameters and return type; parameters are within the
So far, so good. Next, this
Local variables with a Start of 0 are parameters. This two-parameter method contains three parameters. Possibly weird, but hold that thought.
Note line 91: local parameters are all entries in the Then
Why does it do this? Because the
No parameters -- it's a default constructor -- yet it has an entry for Thus, there is a plausible expectation that the LocalVariableTable will have more entries than the method descriptor. We now return to the
(4) is where things fail: the first parameter -- the one we're willing to skip over -- has a type of Again, though, this is really weird; we basically have: class `$serializer` /* : kotlinx.serialization.internal.GeneratedSerializer<com.vmware.chameleon.http.HttpRequest> */ {
fun patch(decoder: Decoder, old: HttpRequest): HttpRequest {
…
}
} except the In fact, I cannot figure out a way to create this "mismatch" using "normal" Kotlin code. The only way I've found to get this "mismatch", wherein the compile-time/run-time type must be of the declaring type, while the LocalVariableTable uses some other type, was to:
The nested |
The only other "fix" I can think of would be to actually check the values within |
Context: dotnet/android#5580
When running
class-parse
on the attached.jar
file (compiled in Kotlin), it is unable to parse theHttpRequest$$serializer
type.classes.zip (Renamed from
classes.jar
.)The text was updated successfully, but these errors were encountered: