[DynInst_API:] [dyninst/dyninst] c20666: Store ifTargetPatch target at full Address width (...


Date: Tue, 02 Jun 2026 09:58:11 -0700
From: bbiiggppiigg <noreply@xxxxxxxxxx>
Subject: [DynInst_API:] [dyninst/dyninst] c20666: Store ifTargetPatch target at full Address width (...
  Branch: refs/heads/master
  Home:   https://github.com/dyninst/dyninst
  Commit: c2066695b6719662b225356b7e82f359a188cb34
      https://github.com/dyninst/dyninst/commit/c2066695b6719662b225356b7e82f359a188cb34
  Author: bbiiggppiigg <bbiiggppiigg@xxxxxxxxx>
  Date:   2026-06-02 (Tue, 02 Jun 2026)

  Changed paths:
    M dyninstAPI/src/patch.h

  Log Message:
  -----------
  Store ifTargetPatch target at full Address width (#2271)

ifTargetPatch held its target in a signed int (32-bit), but it is
constructed in operatorAST.C from an absolute code-buffer address
(elseStartIndex/endIndex + gen.startAddr()). 

The 64-bit Address was
truncated by the constructor. In relocPatch::applyPatch() the pcrel
case computes get_address() - (startAddr() + offset): the minuend was
truncated while the subtrahend kept full width, so they no longer
cancel. When instrumentation is generated above 4 GiB (x86-64 ASLR /
mmap'd trampolines) the resulting branch displacement is garbage.

Widen targetOffset to Dyninst::Address so the full target is preserved.

Co-authored-by: Claude Opus 4.8 <noreply@xxxxxxxxxxxxx>



To unsubscribe from these emails, change your notification settings at https://github.com/dyninst/dyninst/settings/notifications
[← Prev in Thread] Current Thread [Next in Thread→]
  • [DynInst_API:] [dyninst/dyninst] c20666: Store ifTargetPatch target at full Address width (..., bbiiggppiigg <=