forked from TkTech/Burger
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Stop sound packet (nested if statements) are incorrectly parsed #3
Comments
Sample code: class nested {
public void foo(boolean a, boolean b) {
if (a) {
if (b) {
writeByte(3);
} else {
writeByte(1);
}
} else {
if (b) {
writeByte(2);
} else {
writeByte(0);
}
}
}
// as with before, so burger does something
public void writeByte(int n) {}
} and the python thing from #2 Disassembly public void foo(boolean, boolean);
Code:
0: iload_1
1: ifeq 26
4: iload_2
5: ifeq 17
8: aload_0
9: iconst_3
10: invokevirtual #2 // Method writeByte:(I)Ljava/lang/Object;
13: pop
14: goto 45
17: aload_0
18: iconst_1
19: invokevirtual #2 // Method writeByte:(I)Ljava/lang/Object;
22: pop
23: goto 45
26: iload_2
27: ifeq 39
30: aload_0
31: iconst_2
32: invokevirtual #2 // Method writeByte:(I)Ljava/lang/Object;
35: pop
36: goto 45
39: aload_0
40: iconst_0
41: invokevirtual #2 // Method writeByte:(I)Ljava/lang/Object;
44: pop
45: return PIT.operations[
{
"position": 1,
"operation": "if",
"condition": "a"
},
{
"position": 26,
"operation": "else"
},
{
"position": 5,
"operation": "if",
"condition": "b"
},
{
"position": 17,
"operation": "else"
},
{
"position": 10,
"operation": "write",
"type": "byte",
"field": "3"
},
{
"position": 45,
"operation": "endif"
},
{
"position": 19,
"operation": "write",
"type": "byte",
"field": "1"
},
{
"position": 45,
"operation": "endif"
},
{
"position": 27,
"operation": "if",
"condition": "b"
},
{
"position": 39,
"operation": "else"
},
{
"position": 32,
"operation": "write",
"type": "byte",
"field": "2"
},
{
"position": 45,
"operation": "endif"
},
{
"position": 41,
"operation": "write",
"type": "byte",
"field": "0"
}
] PIT.format{
"instructions": [
{
"operation": "if",
"condition": "a",
"instructions": [
{
"operation": "if",
"condition": "b",
"instructions": [
{
"operation": "write",
"type": "byte",
"field": "3"
}
]
},
{
"operation": "else",
"instructions": [
{
"operation": "write",
"type": "byte",
"field": "1"
}
]
},
{
"operation": "else",
"instructions": [
{
"operation": "if",
"condition": "b",
"instructions": [
{
"operation": "write",
"type": "byte",
"field": "2"
}
]
},
{
"operation": "else",
"instructions": [
{
"operation": "write",
"type": "byte",
"field": "0"
}
]
}
]
}
]
}
]
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The stop sound packet (currently 0x4A) incorrectly looks like this:
It should be this:
or this:
The text was updated successfully, but these errors were encountered: