[DynInst_API:] [dyninst/dyninst] 5df750: Fix offset calculation in EmitterAARCH64::emitLoad...


Date: Wed, 01 Oct 2025 16:30:05 -0700
From: Tim Haines <noreply@xxxxxxxxxx>
Subject: [DynInst_API:] [dyninst/dyninst] 5df750: Fix offset calculation in EmitterAARCH64::emitLoad...
  Branch: refs/heads/thaines/aarch64_emitLoadShared_offset_sign
  Home:   https://github.com/dyninst/dyninst
  Commit: 5df75075a3335c3e4d0294c91b9ad2572df723c6
      https://github.com/dyninst/dyninst/commit/5df75075a3335c3e4d0294c91b9ad2572df723c6
  Author: Tim Haines <thaines.astro@xxxxxxxxx>
  Date:   2025-10-01 (Wed, 01 Oct 2025)

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

  Log Message:
  -----------
  Fix offset calculation in EmitterAARCH64::emitLoadShared

'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] 5df750: Fix offset calculation in EmitterAARCH64::emitLoad..., Tim Haines <=