aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authoryronglin <yronglin777@gmail.com>2022-09-07 12:46:20 -0400
committerAaron Ballman <aaron@aaronballman.com>2022-09-07 12:46:20 -0400
commit6ed21fc515230ac2ea459d8aa90566e9a467bbb0 (patch)
treedcfde6cda53dfaa14c75a5df24c8e08001df9296 /clang/lib/CodeGen/CodeGenFunction.cpp
parente5d2d3eafbb367450c4fb75d3ee72b3b4bba522b (diff)
downloadllvm-6ed21fc515230ac2ea459d8aa90566e9a467bbb0.zip
llvm-6ed21fc515230ac2ea459d8aa90566e9a467bbb0.tar.gz
llvm-6ed21fc515230ac2ea459d8aa90566e9a467bbb0.tar.bz2
Avoid __builtin_assume_aligned crash when the 1st arg is array type
Avoid __builtin_assume_aligned crash when the 1st arg is array type (or string literal). Fixes Issue #57169 Differential Revision: https://reviews.llvm.org/D133202
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index caf1486..35a8f1d 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -2443,8 +2443,6 @@ void CodeGenFunction::emitAlignmentAssumption(llvm::Value *PtrValue,
SourceLocation AssumptionLoc,
llvm::Value *Alignment,
llvm::Value *OffsetValue) {
- if (auto *CE = dyn_cast<CastExpr>(E))
- E = CE->getSubExprAsWritten();
QualType Ty = E->getType();
SourceLocation Loc = E->getExprLoc();