[DynInst_API:] [dyninst/dyninst] 8676f1: Fix undefined behavior in integer operations (#1434)


Date: Thu, 11 May 2023 10:47:20 -0700
From: Tim Haines <noreply@xxxxxxxxxx>
Subject: [DynInst_API:] [dyninst/dyninst] 8676f1: Fix undefined behavior in integer operations (#1434)
  Branch: refs/heads/master
  Home:   https://github.com/dyninst/dyninst
  Commit: 8676f10714fb0bb7d0a3e7c65ec729d7db195d94
      https://github.com/dyninst/dyninst/commit/8676f10714fb0bb7d0a3e7c65ec729d7db195d94
  Author: Tim Haines <thaines.astro@xxxxxxxxx>
  Date:   2023-05-11 (Thu, 11 May 2023)

  Changed paths:
    M dyninstAPI/src/BPatch_addressSpace.C
    M dyninstAPI/src/codegen-power.C
    M instructionAPI/src/InstructionDecoder-aarch64.C
    M parseAPI/src/Block.C
    M parseAPI/src/Function.C
    M patchAPI/h/Point.h
    M proccontrol/src/x86_process.C

  Log Message:
  -----------
  Fix undefined behavior in integer operations (#1434)

* Shifting signed 32-bit value by 31 bits is undefined behavior

This was found using cppcheck's shiftTooManyBitsSigned.

* Signed to unsigned conversion in calculation

These were found using cppcheck's signConversion.

* Fix signed overflow

This was found using cppcheck's integerOverflowCond.

* Shifting negative value

This was found using cppcheck's shiftNegativeLHS.

* BPatch_addressSpace::deleteSnippet: fix enumeral conversion in conditional


[← Prev in Thread] Current Thread [Next in Thread→]
  • [DynInst_API:] [dyninst/dyninst] 8676f1: Fix undefined behavior in integer operations (#1434), Tim Haines <=