aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorPhilip Reames <preames@rivosinc.com>2022-06-07 13:27:13 -0700
committerPhilip Reames <listmail@philipreames.com>2022-06-07 13:27:13 -0700
commit89c4b29e8d35ec352019d828e546bea3850403df (patch)
tree8bfc7297d68fbe4bd850ec7428cd747849df8437 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parent8a0cd23326050a7b999efa2cf455880772ce9211 (diff)
downloadllvm-89c4b29e8d35ec352019d828e546bea3850403df.zip
llvm-89c4b29e8d35ec352019d828e546bea3850403df.tar.gz
llvm-89c4b29e8d35ec352019d828e546bea3850403df.tar.bz2
[GuardWidening] Fix a nasty cast bug in c2eccc6
c2eccc6 introduced a call to etHasNoUnsignedWrap which implicitly assumes that Inst is a OverflowingBinaryOperator. This is frequently untrue, but was not caught because cast<Ty>(X) has been broken, see https://discourse.llvm.org/t/cast-x-is-broken-implications-and-proposal-to-address/63033 for context. I considered reverting this, but since doing so re-introduces a nasty miscompile of its own, I decided to fix forward instead. I'll note that this is a particularly nasty form of the cast<Ty>(X) issue. Because the cast was succeeding unexpected, we were writing data to instructions which weren't OBOs. This could result in near arbitrary data or memory corruption. I'm a bit shocked that the sanitizers didn't find this TBH.
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
0 files changed, 0 insertions, 0 deletions