Skip to content

Commit 2ea623d

Browse files
committed
cpu/drcbearm64.cpp: Don't try to get offset of unbound labels even if it won't be used.
1 parent 7b7adbd commit 2ea623d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/devices/cpu/drcbearm64.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2080,7 +2080,7 @@ void drcbe_arm64::op_jmp(a64::Assembler &a, const uml::instruction &inst)
20802080
}
20812081

20822082
const bool bound = a.code()->is_label_bound(jmptarget);
2083-
const uint64_t targetoffs = a.code()->base_address() + a.code()->label_offset(jmptarget);
2083+
const uint64_t targetoffs = bound ? (a.code()->base_address() + a.code()->label_offset(jmptarget)) : 0;
20842084
const uint64_t codeoffs = a.code()->base_address() + a.offset();
20852085
const bool tbnzrange = bound && is_valid_immediate_signed(int64_t(targetoffs) - codeoffs, 14 + 2);
20862086

0 commit comments

Comments
 (0)