Permalink
Browse files

Merge pull request #1788 from donc/valgrind_unintialized

Fix uninitialized vars in EnumDeclaration
  • Loading branch information...
2 parents 0442749 + 4dfaf02 commit 37c95de25727dc95399039eb00b6adad9f1fb92a @yebblies yebblies committed Mar 22, 2013
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/enum.c
View
@@ -34,6 +34,8 @@ EnumDeclaration::EnumDeclaration(Loc loc, Identifier *id, Type *memtype)
isdeprecated = 0;
isdone = 0;
objFileDone = 0;
+ protection = PROTundefined;
+ parent = NULL;
}
Dsymbol *EnumDeclaration::syntaxCopy(Dsymbol *s)
@@ -75,6 +77,10 @@ void EnumDeclaration::semantic0(Scope *sc)
if (isdone || !scope)
return;
+
+ parent = scope->parent;
+ protection = scope->protection;
+
if (!isAnonymous() || memtype)
return;
for (size_t i = 0; i < members->dim; i++)

0 comments on commit 37c95de

Please sign in to comment.