llvm.org GIT mirror llvm / ed5628c
[Object] Initialize LoadConfig member to null Executables may not contain a load config, and clients should be able to test for nullability. Previously we'd return uninitialized memory. Now getLoadConfig32/64 return valid pointers or null. Fixes PR34108 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310308 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Kleckner 2 years ago
3 changed file(s) with 6 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
752752 const debug_directory *DebugDirectoryBegin;
753753 const debug_directory *DebugDirectoryEnd;
754754 // Either coff_load_configuration32 or coff_load_configuration64.
755 const void *LoadConfig;
755 const void *LoadConfig = nullptr;
756756
757757 std::error_code getString(uint32_t offset, StringRef &Res) const;
758758
11 RUN: llvm-readobj -coff-load-config %S/Inputs/coff-load-config-x64.dll | FileCheck %s --check-prefix=X64
22
33 RUN: llvm-readobj -coff-load-config %S/Inputs/coff-load-config-data-end.exe | FileCheck %s --check-prefix=DATAEND
4
5 RUN: llvm-readobj -coff-load-config %S/Inputs/coff-no-load-config.exe | FileCheck %s --check-prefix=NOCONFIG
46
57 X86: LoadConfig [
68 X86: Size: 0x5C
9092 DATAEND: SEHTable [
9193 DATAEND-NEXT: 0x402006
9294 DATAEND-NEXT: ]
95
96 NOCONFIG: Format: COFF-x86-64
97 NOCONFIG-NOT: LoadConfig