[DynInst_API:] [dyninst/dyninst] ea2f33: Fix offset calculations in EmitterAARCH64 (#2022)


Date: Wed, 01 Oct 2025 22:16:01 -0700
From: Tim Haines <noreply@xxxxxxxxxx>
Subject: [DynInst_API:] [dyninst/dyninst] ea2f33: Fix offset calculations in EmitterAARCH64 (#2022)
  Branch: refs/heads/master
  Home:   https://github.com/dyninst/dyninst
  Commit: ea2f333b262bebc4378a58292a46f446a804df3e
      https://github.com/dyninst/dyninst/commit/ea2f333b262bebc4378a58292a46f446a804df3e
  Author: Tim Haines <thaines.astro@xxxxxxxxx>
  Date:   2025-10-02 (Thu, 02 Oct 2025)

  Changed paths:
    M dyninstAPI/src/Relocation/Widgets/PCWidget-aarch64.C
    M dyninstAPI/src/inst-aarch64.C

  Log Message:
  -----------
  Fix offset calculations in EmitterAARCH64 (#2022)

'varOffset' is defined as

Address varOffset = addr - gen.currAddr() + 4;

When 'addr' is less than 'gen.currAddr()', this calculation underflows.
Since 'labs' takes a 'long int', the underflowed 'unsigned long' (that
is what 'Address' really is) gets converted to a signed value. Removing
this conversion and the subsequent absolute value caused 'varOffset' to
be treated as a large, positive number.

This was broken by 9b6dd2aa6b.



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] ea2f33: Fix offset calculations in EmitterAARCH64 (#2022), Tim Haines <=