llvm-project/llvm/test/Transforms/CodeGenPrepare
Sanjay Patel acceedb15f [CodeGenPrepare] Fix use-after-free
If OptimizeExtractBits() encountered a shift instruction with no operands at all,
it would erase the instruction, but still return false.

This previously didn’t matter because its caller would always return after
processing the instruction, but https://reviews.llvm.org/D63233 changed the
function’s caller to fall through if it returned false, which would then cause
a use-after-free detectable by ASAN.

This change makes OptimizeExtractBits return true if it removes a shift
instruction with no users, terminating processing of the instruction.

Patch by: @brentdax (Brent Royal-Gordon)

Differential Revision: https://reviews.llvm.org/D66330

llvm-svn: 369168
2019-08-16 23:10:34 +00:00
..
AArch64 [lit] Delete empty lines at the end of lit.local.cfg NFC 2019-06-17 09:51:07 +00:00
AMDGPU [lit] Delete empty lines at the end of lit.local.cfg NFC 2019-06-17 09:51:07 +00:00
ARM [lit] Delete empty lines at the end of lit.local.cfg NFC 2019-06-17 09:51:07 +00:00
Mips
NVPTX
X86 [lit] Delete empty lines at the end of lit.local.cfg NFC 2019-06-17 09:51:07 +00:00
2008-11-24-RAUW-Self.ll
basic.ll
bitreverse-hang.ll
builtin-condition.ll
crash-on-large-allocas.ll
dom-tree.ll
gep-unmerging.ll
invariant.group.ll
nonintegral.ll
section-samplepgo.ll
section.ll
sink-shift-and-trunc.ll [CodeGenPrepare] Fix use-after-free 2019-08-16 23:10:34 +00:00
skip-merging-case-block.ll
split-indirect-loop.ll
statepoint-relocate.ll
widenable-condition.ll