[DynInst_API:] [dyninst/dyninst] d6f7ae: Remove undefined behavior from bit-shifting code


Date: Thu, 07 Feb 2019 14:33:14 -0800
From: Tim Haines <noreply@xxxxxxxxxx>
Subject: [DynInst_API:] [dyninst/dyninst] d6f7ae: Remove undefined behavior from bit-shifting code
  Branch: refs/heads/master
  Home:   https://github.com/dyninst/dyninst
  Commit: d6f7ae96cc9d06e827e8b0cad7aaaf7d3d020e6a
      https://github.com/dyninst/dyninst/commit/d6f7ae96cc9d06e827e8b0cad7aaaf7d3d020e6a
  Author: Tim Haines <thaines.astro@xxxxxxxxx>
  Date:   2019-02-07 (Thu, 07 Feb 2019)

  Changed paths:
    M dataflowAPI/rose/semantics/DispatcherPowerpc.C
    M dyninstAPI/src/codegen-aarch64.C
    M dyninstAPI/src/codegen-x86.C
    M dyninstAPI/src/inst-x86.C
    M instructionAPI/src/InstructionDecoder-aarch64.h

  Log Message:
  -----------
  Remove undefined behavior from bit-shifting code

PR #536 

Overflow of signed integer arithmetic (including shifting) is
undefined behavior in C++. Compilers are allowed to exploit
this UB for optimization purposes up to and including not
emitting any opcodes.

These were found using cppcheck.


[← Prev in Thread] Current Thread [Next in Thread→]
  • [DynInst_API:] [dyninst/dyninst] d6f7ae: Remove undefined behavior from bit-shifting code, Tim Haines <=