Explicitly initialize the options array, MinGW's gcc 4.3.5 appears to have a bug

in array value-initialization.

llvm-svn: 75518
This commit is contained in:
Daniel Dunbar 2009-07-13 21:50:47 +00:00
parent 48b4d1e27e
commit 9ab53d2b17
1 changed files with 5 additions and 1 deletions

View File

@ -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) {