0001-Fix-uninitialized-value-in-ABIArgInfo.patch 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. From 565b9633ee68b311c1a954022869d9e99fee7286 Mon Sep 17 00:00:00 2001
  2. From: serge-sans-paille <sguelton@redhat.com>
  3. Date: Fri, 1 Feb 2019 06:39:13 +0000
  4. Subject: [PATCH] Fix uninitialized value in ABIArgInfo
  5. GCC-9 takes advantage of this uninitialized values to optimize stuff,
  6. which ends up in failing validation when compiling clang.
  7. ---
  8. include/clang/CodeGen/CGFunctionInfo.h | 11 +++++------
  9. 1 file changed, 5 insertions(+), 6 deletions(-)
  10. diff --git a/include/clang/CodeGen/CGFunctionInfo.h b/include/clang/CodeGen/CGFunctionInfo.h
  11. index cf64e9f3ee..131eb38393 100644
  12. --- a/include/clang/CodeGen/CGFunctionInfo.h
  13. +++ b/include/clang/CodeGen/CGFunctionInfo.h
  14. @@ -112,14 +112,13 @@ private:
  15. }
  16. ABIArgInfo(Kind K)
  17. - : TheKind(K), PaddingInReg(false), InReg(false), SuppressSRet(false) {
  18. - }
  19. + : TypeData(nullptr), PaddingType(nullptr), DirectOffset(0),
  20. + TheKind(K), PaddingInReg(false), InAllocaSRet(false), IndirectByVal(false),
  21. + IndirectRealign(false), SRetAfterThis(false), InReg(false),
  22. + CanBeFlattened(false), SignExt(false), SuppressSRet(false) {}
  23. public:
  24. - ABIArgInfo()
  25. - : TypeData(nullptr), PaddingType(nullptr), DirectOffset(0),
  26. - TheKind(Direct), PaddingInReg(false), InReg(false),
  27. - SuppressSRet(false) {}
  28. + ABIArgInfo() : ABIArgInfo(Direct) {}
  29. static ABIArgInfo getDirect(llvm::Type *T = nullptr, unsigned Offset = 0,
  30. llvm::Type *Padding = nullptr,
  31. --
  32. 2.19.2