From: Serge Guelton Date: Thu, 19 Sep 2019 00:54:40 +0000 (+0000) Subject: Initialize all fields in ABIArgInfo. X-Git-Tag: llvmorg-11-init~8859 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e93aded7f02d661234ad81aac0785ccdef6a79dd;p=platform%2Fupstream%2Fllvm.git Initialize all fields in ABIArgInfo. Due to usage of an uninitialized fields, we end up with a Conditional jump or move depends on uninitialised value Fixes https://bugs.llvm.org/show_bug.cgi?id=40547 Commited on behalf of Martin Liska llvm-svn: 372281 --- diff --git a/clang/include/clang/CodeGen/CGFunctionInfo.h b/clang/include/clang/CodeGen/CGFunctionInfo.h index 1f81072..5069d9a 100644 --- a/clang/include/clang/CodeGen/CGFunctionInfo.h +++ b/clang/include/clang/CodeGen/CGFunctionInfo.h @@ -109,14 +109,12 @@ private: UnpaddedCoerceAndExpandType = T; } - ABIArgInfo(Kind K) - : TheKind(K), PaddingInReg(false), InReg(false) { - } - public: - ABIArgInfo() + ABIArgInfo(Kind K = Direct) : TypeData(nullptr), PaddingType(nullptr), DirectOffset(0), - TheKind(Direct), PaddingInReg(false), InReg(false) {} + TheKind(K), PaddingInReg(false), InAllocaSRet(false), + IndirectByVal(false), IndirectRealign(false), SRetAfterThis(false), + InReg(false), CanBeFlattened(false), SignExt(false) {} static ABIArgInfo getDirect(llvm::Type *T = nullptr, unsigned Offset = 0, llvm::Type *Padding = nullptr,