From 04c50b6cfd0004bae44fa135c8493561ed608f55 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Wed, 16 Dec 2020 09:26:18 +0000 Subject: [PATCH] sclog: add missing instr_set_translation. When we invent a movzx instruction as part of shift-count logging on x86, we apparently need to set its 'translation' field to point at a pre-existing instruction that it's logically related to. Later versions of DynamoRIO than I was running with will complain if this isn't done. --- test/sclog/sclog.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/sclog/sclog.c b/test/sclog/sclog.c index 20c1e441..2d2adbf4 100644 --- a/test/sclog/sclog.c +++ b/test/sclog/sclog.c @@ -452,8 +452,9 @@ static dr_emit_flags_t instrument_instr( st = drreg_reserve_register(drcontext, bb, instr, NULL, &r0); DR_ASSERT(st == DRREG_SUCCESS); opnd_t op_r0 = opnd_create_reg(r0); - instrlist_preinsert(bb, instr, INSTR_CREATE_movzx( - drcontext, op_r0, shiftcount)); + instr_t *movzx = INSTR_CREATE_movzx(drcontext, op_r0, shiftcount); + instr_set_translation(movzx, instr_get_app_pc(instr)); + instrlist_preinsert(bb, instr, movzx); instr_format_location(instr, &loc); dr_insert_clean_call( drcontext, bb, instr, (void *)log_var_shift, false,