llvm-project/llvm
Sanjay Patel 587fd849f0 [InstCombine] Fix matchRotate bug when one operand is a ConstantExpr shift
This bug seems to be harmless in release builds, but will cause an error in UBSAN
builds or an assertion failure in debug builds.

When it gets to this opcode comparison, it assumes both of the operands are BinaryOperators,
but the prior m_LogicalShift will also match a ConstantExpr. The cast<BinaryOperator> will
assert in a debug build, or reading an invalid value for BinaryOp from memory with
((BinaryOperator*)constantExpr)->getOpcode() will cause an error in a UBSAN build.

The test I added will fail without this change in debug/UBSAN builds, but not in release.

Patch by: @AndrewScheidecker (Andrew Scheidecker)

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

llvm-svn: 353736
2019-02-11 19:26:27 +00:00
..
benchmarks
bindings Fix format string in bindings/go/llvm/ir_test.go (PR40561) 2019-02-05 11:01:54 +00:00
cmake [llvm] [cmake] Use current directory in GenerateVersionFromVCS 2019-02-11 09:07:07 +00:00
docs Add recipes for migrating downstream branches of git mirrors 2019-02-11 15:40:02 +00:00
examples Fix compilation of examples after 13680223b9 / r352827 2019-02-01 03:23:42 +00:00
include [SelectionDAGBuilder] Add restrictions to EmitFuncArgumentDbgValue 2019-02-11 19:23:30 +00:00
lib [InstCombine] Fix matchRotate bug when one operand is a ConstantExpr shift 2019-02-11 19:26:27 +00:00
projects Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
resources
runtimes [CMake] Don't set <PROJECT>_STANDALONE_BUILD 2019-02-09 03:06:56 +00:00
test [InstCombine] Fix matchRotate bug when one operand is a ConstantExpr shift 2019-02-11 19:26:27 +00:00
tools [DebugInfo] Fix /usr/lib/debug llvm-symbolizer lookup with relative paths 2019-02-11 18:05:48 +00:00
unittests Update files that were mistakenly added with the old file header to the 2019-02-11 08:07:38 +00:00
utils test-release.sh: Add option to use ninja 2019-02-11 10:30:22 +00:00
.arcconfig
.clang-format
.clang-tidy Disable tidy checks with too many hits 2019-02-01 11:20:13 +00:00
.gitattributes
.gitignore gitignore: ignore clangd index files. 2019-01-25 14:05:18 +00:00
CMakeLists.txt This reverts commit 1440a848a635849b97f7a5cfa0ecc40d37451f5b. 2019-02-09 00:46:12 +00:00
CODE_OWNERS.TXT
CREDITS.TXT Remove a period from CREDITS.TXT (testing email change). NFC 2019-01-19 09:07:38 +00:00
LICENSE.TXT Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
LLVMBuild.txt Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
README.txt
RELEASE_TESTERS.TXT
configure
llvm.spec.in Update structured references to the license to the new license. 2019-01-19 11:30:51 +00:00

README.txt

The LLVM Compiler Infrastructure
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.