Add check for non-NULL Variable with a NULL Type.

llvm-svn: 147149
This commit is contained in:
Jim Ingham
2011-12-22 17:03:37 +00:00
parent f5bde09cc1
commit b7c91a27fb

View File

@@ -213,7 +213,12 @@ Value::GetValueByteSize (clang::ASTContext *ast_context, Error *error_ptr)
case eContextTypeVariable: // Variable *
if (GetVariable())
byte_size = GetVariable()->GetType()->GetByteSize();
{
if (GetVariable()->GetType())
byte_size = GetVariable()->GetType()->GetByteSize();
else if (error_ptr)
error_ptr->SetErrorString ("Can't determine byte size with NULL Type *.");
}
else if (error_ptr)
error_ptr->SetErrorString ("Can't determine byte size with NULL Variable *.");
break;