qemu: fix UBSAN errors in tcg and arm translation

This commit is contained in:
StalkR
2023-11-14 10:22:18 +01:00
parent 6db5d1a036
commit db63f2d9d7
2 changed files with 4 additions and 3 deletions

View File

@@ -46,8 +46,9 @@ static inline void gen_uc_tracecode(TCGContext *tcg_ctx, int32_t size, int32_t t
0
};
if (puc->hooks_count[type] == 1) {
cur = puc->hook[type].head;
const int hook_type = type & UC_HOOK_IDX_MASK;
if (puc->hooks_count[hook_type] == 1) {
cur = puc->hook[hook_type].head;
while (cur) {
hk = cur->data;