Fix crash in SwitchStmt::TypeCheck() with malformed programs.
This commit is contained in:
7
stmt.cpp
7
stmt.cpp
@@ -2586,9 +2586,12 @@ SwitchStmt::Print(int indent) const {
|
||||
|
||||
Stmt *
|
||||
SwitchStmt::TypeCheck() {
|
||||
const Type *exprType = expr->GetType();
|
||||
if (exprType == NULL)
|
||||
const Type *exprType;
|
||||
if (expr == NULL ||
|
||||
(exprType = expr->GetType()) == NULL) {
|
||||
Assert(m->errorCount > 0);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const Type *toType = NULL;
|
||||
exprType = exprType->GetAsConstType();
|
||||
|
||||
Reference in New Issue
Block a user