[cfe-commits] r68916 - /cfe/trunk/lib/Sema/SemaDecl.cpp

Chris Lattner sabre at nondot.org
Sun Apr 12 15:12:07 PDT 2009


Author: lattner
Date: Sun Apr 12 17:12:06 2009
New Revision: 68916

URL: http://llvm.org/viewvc/llvm-project?rev=68916&view=rev
Log:
fix code that incorrectly assumed that GetTypeForDeclarator cannot
return null.

Modified:
    cfe/trunk/lib/Sema/SemaDecl.cpp

Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=68916&r1=68915&r2=68916&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Sun Apr 12 17:12:06 2009
@@ -2678,9 +2678,11 @@
   // type was invalid, GetTypeForDeclarator() still returns a "valid" type,
   // though it will not reflect the user specified type.
   QualType parmDeclType = GetTypeForDeclarator(D, S);
+  if (parmDeclType.isNull()) {
+    D.setInvalidType(true);
+    parmDeclType = Context.IntTy;
+  }
   
-  assert(!parmDeclType.isNull() && "GetTypeForDeclarator() returned null type");
-
   // TODO: CHECK FOR CONFLICTS, multiple decls with same name in one scope.
   // Can this happen for params?  We already checked that they don't conflict
   // among each other.  Here they can only shadow globals, which is ok.





More information about the cfe-commits mailing list