[DynInst_API:] [dyninst/dyninst] 991463: Store ifTargetPatch target at full Address width


Date: Sun, 31 May 2026 17:36:02 -0700
From: bbiiggppiigg <noreply@xxxxxxxxxx>
Subject: [DynInst_API:] [dyninst/dyninst] 991463: Store ifTargetPatch target at full Address width
  Branch: refs/heads/bbiiggppiigg/fix-iftarget-addr-width
  Home:   https://github.com/dyninst/dyninst
  Commit: 99146377ad575da69c5c28458e35f2fc308ed551
      https://github.com/dyninst/dyninst/commit/99146377ad575da69c5c28458e35f2fc308ed551
  Author: wuxx1279 <bbiiggppiigg@xxxxxxxxx>
  Date:   2026-05-31 (Sun, 31 May 2026)

  Changed paths:
    M dyninstAPI/src/patch.h

  Log Message:
  -----------
  Store ifTargetPatch target at full Address width

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] 991463: Store ifTargetPatch target at full Address width, bbiiggppiigg <=