aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2021-12-21 15:28:45 +0100
committerNikita Popov <npopov@redhat.com>2021-12-23 10:53:15 +0100
commit09669e6c5fa1e8db9c1091cc264640fb0377d6b6 (patch)
tree49a4da5187b74b2be6d69d8d2d4904eaa61d1135 /clang/lib/CodeGen/CodeGenFunction.cpp
parent33319dde2a4f594ba763f82e89b7cf4024416ff8 (diff)
downloadllvm-09669e6c5fa1e8db9c1091cc264640fb0377d6b6.zip
llvm-09669e6c5fa1e8db9c1091cc264640fb0377d6b6.tar.gz
llvm-09669e6c5fa1e8db9c1091cc264640fb0377d6b6.tar.bz2
[CodeGen] Avoid pointer element type access when creating LValue
This required fixing two places that were passing the pointer type rather than the expected pointee type to the method.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index b437ba0..e6adec6 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -188,8 +188,8 @@ LValue CodeGenFunction::MakeNaturalAlignAddrLValue(llvm::Value *V, QualType T) {
LValueBaseInfo BaseInfo;
TBAAAccessInfo TBAAInfo;
CharUnits Alignment = CGM.getNaturalTypeAlignment(T, &BaseInfo, &TBAAInfo);
- return LValue::MakeAddr(Address(V, Alignment), T, getContext(), BaseInfo,
- TBAAInfo);
+ Address Addr(V, ConvertTypeForMem(T), Alignment);
+ return LValue::MakeAddr(Addr, T, getContext(), BaseInfo, TBAAInfo);
}
/// Given a value of type T* that may not be to a complete object,