aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/VirtualFileSystemTest.cpp
diff options
context:
space:
mode:
authorBjorn Pettersson <bjorn.a.pettersson@ericsson.com>2022-01-31 13:49:35 +0100
committerBjorn Pettersson <bjorn.a.pettersson@ericsson.com>2022-02-03 21:03:58 +0100
commit0352ee1a225ae3a54f8cda9ead710498a60ff09a (patch)
treea54fc92072fd0090e22a2ec0d68d82461a579265 /llvm/unittests/Support/VirtualFileSystemTest.cpp
parent1d111090ad0c2c022c67ef26e25949669c28a0c7 (diff)
downloadllvm-0352ee1a225ae3a54f8cda9ead710498a60ff09a.zip
llvm-0352ee1a225ae3a54f8cda9ead710498a60ff09a.tar.gz
llvm-0352ee1a225ae3a54f8cda9ead710498a60ff09a.tar.bz2
[CodeGenPrepare] Avoid out-of-bounds shift
AddressingModeMatcher::matchOperationAddr may attempt to shift a variable by the same amount of steps as found in the IR in a SHL instruction. This was done without considering that there could be undefined behavior in the IR, so the shift performed when compiling could end up having undefined behavior as well. This patch avoid UB in the codegenprepare by making sure that we limit the shift amount used, in a similar way as already being done in CodeGenPrepare::optimizeLoadExt. Differential Revision: https://reviews.llvm.org/D118602
Diffstat (limited to 'llvm/unittests/Support/VirtualFileSystemTest.cpp')
0 files changed, 0 insertions, 0 deletions