@@ -455,16 +455,21 @@ static void gen_sub_carry(TCGContext *tcg_ctx, TCGv_i32 dest, TCGv_i32 t0, TCGv_
455
455
static inline void mb_tcg_opcode_cmp_hook (TCGContext * tcg_ctx , TCGv_i32 v0 , TCGv_i32 v1 , uint32_t size )
456
456
{
457
457
uc_engine * uc = tcg_ctx -> uc ;
458
- TCGv_i64 targ1 = temp_tcgv_i64 (tcg_ctx , tcgv_i32_temp (tcg_ctx , v0 ));
459
- TCGv_i64 targ2 = temp_tcgv_i64 (tcg_ctx , tcgv_i32_temp (tcg_ctx , v1 ));
458
+
460
459
if (HOOK_EXISTS_BOUNDED (uc , UC_HOOK_TCG_OPCODE , tcg_ctx -> pc_start )) {
461
460
struct hook * hook ;
462
461
HOOK_FOREACH_VAR_DECLARE ;
463
462
HOOK_FOREACH (uc , hook , UC_HOOK_TCG_OPCODE ) {
464
463
if (hook -> to_delete )
465
464
continue ;
466
465
if (hook -> op == UC_TCG_OP_SUB && (hook -> op_flags & UC_TCG_OP_FLAG_CMP )) {
466
+ TCGv_i64 targ1 = tcg_temp_new_i64 (tcg_ctx );
467
+ TCGv_i64 targ2 = tcg_temp_new_i64 (tcg_ctx );
468
+ tcg_gen_extu_i32_i64 (tcg_ctx , targ1 , v0 );
469
+ tcg_gen_extu_i32_i64 (tcg_ctx , targ2 , v1 );
467
470
gen_uc_traceopcode (tcg_ctx , hook , targ1 , targ2 , size , uc , tcg_ctx -> pc_start );
471
+ tcg_temp_free_i64 (tcg_ctx , targ1 );
472
+ tcg_temp_free_i64 (tcg_ctx , targ2 );
468
473
}
469
474
}
470
475
}
0 commit comments