diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-07-13 21:50:47 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-07-13 21:50:47 +0000 |
commit | 47393ba7caff1db4f90f57db83a2dfcf373d79d3 (patch) | |
tree | 91843a17cc9a86ed79e1b075fe64500efec66a34 /lib/Driver/OptTable.cpp | |
parent | 3d399a010102966158f6b69b07d636f113dc6ab4 (diff) |
Explicitly initialize the options array, MinGW's gcc 4.3.5 appears to have a bug
in array value-initialization.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75518 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/OptTable.cpp')
-rw-r--r-- | lib/Driver/OptTable.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Driver/OptTable.cpp b/lib/Driver/OptTable.cpp index 7ea6a8b0d9..8c88575764 100644 --- a/lib/Driver/OptTable.cpp +++ b/lib/Driver/OptTable.cpp @@ -91,7 +91,11 @@ static Info &getInfo(unsigned id) { return OptionInfos[id - 1]; } -OptTable::OptTable() : Options(new Option*[numOptions]()) { +OptTable::OptTable() : Options(new Option*[numOptions]) { + // Explicitly zero initialize the error to work around a bug in array + // value-initialization on MinGW with gcc 4.3.5. + memset(Options, 0, sizeof(*Options) * numOptions); + // Find start of normal options. FirstSearchableOption = 0; for (unsigned i = OPT_UNKNOWN + 1; i < LastOption; ++i) { |