1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

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.
This commit is contained in:
Simon Tatham 2020-12-16 09:26:18 +00:00
parent 353db3132f
commit 04c50b6cfd

View File

@ -452,8 +452,9 @@ static dr_emit_flags_t instrument_instr(
st = drreg_reserve_register(drcontext, bb, instr, NULL, &r0); st = drreg_reserve_register(drcontext, bb, instr, NULL, &r0);
DR_ASSERT(st == DRREG_SUCCESS); DR_ASSERT(st == DRREG_SUCCESS);
opnd_t op_r0 = opnd_create_reg(r0); opnd_t op_r0 = opnd_create_reg(r0);
instrlist_preinsert(bb, instr, INSTR_CREATE_movzx( instr_t *movzx = INSTR_CREATE_movzx(drcontext, op_r0, shiftcount);
drcontext, op_r0, shiftcount)); instr_set_translation(movzx, instr_get_app_pc(instr));
instrlist_preinsert(bb, instr, movzx);
instr_format_location(instr, &loc); instr_format_location(instr, &loc);
dr_insert_clean_call( dr_insert_clean_call(
drcontext, bb, instr, (void *)log_var_shift, false, drcontext, bb, instr, (void *)log_var_shift, false,