I wonder if the variable merging covers up a bug in Fernflower's SSA implementation?
I wonder if the variable merging covers up a bug in Fernflower's SSA implementation?
gpe
changed title from try/finally block in the (SD) signlink decompiled incorrectly to RandomAccessFile variable incorrectly split in SignLink class4 years ago
Similarly, the opcode variable is incorrectly split in the ScriptRunner class:
@Pc(25) byte local25 = -1;
try {
@Pc(27) int instructions = 0;
label4473:
while (true) {
instructions++;
if (instructions > maxInstructions) {
throw new RuntimeException("slow");
}
pc++;
@Pc(45) int opcode = opcodes[pc];
local25 should be opcode here.
Similarly, the opcode variable is incorrectly split in the `ScriptRunner` class:
```
@Pc(25) byte local25 = -1;
try {
@Pc(27) int instructions = 0;
label4473:
while (true) {
instructions++;
if (instructions > maxInstructions) {
throw new RuntimeException("slow");
}
pc++;
@Pc(45) int opcode = opcodes[pc];
```
`local25` should be `opcode` here.
The problematic method is the one for finding the cache (search for
".openrs2_cache_"
).Actually, it might not be a try/finally block. However, the variable scoping is wrong.
Seems to be caused by us commenting out simpleMerge() in Fernflower.
I wonder if the variable merging covers up a bug in Fernflower's SSA implementation?
try/finally block in the (SD) signlink decompiled incorrectlyto RandomAccessFile variable incorrectly split in SignLink class 4 years agoSimilarly, the opcode variable is incorrectly split in the
ScriptRunner
class:local25
should beopcode
here.Is the renaming being automated?
The bug is in Fernflower's SSA implementation (though I've no clue what it is yet), it isn't related to naming.