[decompiler] handle pointer to symbol value, clean up prints on offline test (#1978)

- fix issue described in
https://github.com/open-goal/jak-project/issues/1939
- fix `text`, which was manually patched with the wrong offset (was
reading the symbol value off by one byte)
- clean up some random useless prints
- make the offline tests keep trying if there's a comparison error,
clean up the output a bit so the diffs are all at the end.
This commit is contained in:
water111
2022-10-16 18:19:59 -04:00
committed by GitHub
parent e7bb0fb68d
commit ddd60fca48
21 changed files with 291 additions and 509 deletions
+8 -2
View File
@@ -575,8 +575,14 @@ std::unique_ptr<AtomicOp> convert_lw_1(const Instruction& i0, int idx) {
std::unique_ptr<AtomicOp> convert_daddiu_1(const Instruction& i0, int idx, GameVersion version) {
if (i0.get_src(0).is_reg(rs7()) && i0.get_src(1).is_sym()) {
// get symbol pointer
return std::make_unique<SetVarOp>(
make_dst_var(i0, idx), SimpleAtom::make_sym_ptr(i0.get_src(1).get_sym()).as_expr(), idx);
if (i0.get_src(1).kind == InstructionAtom::IMM_SYM_VAL_PTR) {
return std::make_unique<SetVarOp>(
make_dst_var(i0, idx), SimpleAtom::make_sym_val_ptr(i0.get_src(1).get_sym()).as_expr(),
idx);
} else {
return std::make_unique<SetVarOp>(
make_dst_var(i0, idx), SimpleAtom::make_sym_ptr(i0.get_src(1).get_sym()).as_expr(), idx);
}
} else if (i0.get_src(0).is_reg(rs7()) &&
i0.get_src(1).is_imm(empty_pair_offset_from_s7(version))) {
// get empty pair