From 46d2bad231cdd328c3d0e1344fb0f2d8e664242a Mon Sep 17 00:00:00 2001 From: Matt Pharr Date: Fri, 9 Sep 2011 09:24:13 -0700 Subject: [PATCH] Fix malformed program crash --- module.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/module.cpp b/module.cpp index cc8e46f5..d3dd8d85 100644 --- a/module.cpp +++ b/module.cpp @@ -457,6 +457,10 @@ Module::AddGlobal(DeclSpecs *ds, Declarator *decl) { // declarations, typedefs, and global variables declarations / // definitions. Figure out what we've got and take care of it. + if (ds == NULL || decl == NULL) + // Error happened earlier during parsing + return; + if (decl->isFunction) { // function declaration const Type *t = decl->GetType(ds);