From 1d18d8080fb30ed273217ef22ab8ad2b40787ed4 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Thu, 18 Feb 2016 08:33:34 -0800 Subject: [PATCH] Fix crash when encountering invalid identifier --- hecl/lib/Frontend/Lexer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hecl/lib/Frontend/Lexer.cpp b/hecl/lib/Frontend/Lexer.cpp index 670c0c81e..833dba6a3 100644 --- a/hecl/lib/Frontend/Lexer.cpp +++ b/hecl/lib/Frontend/Lexer.cpp @@ -407,7 +407,7 @@ void Lexer::EmitVec4(IR& ir, const Lexer::OperationNode* funcNode, IR::RegID tar const Parser::Token* imms[4]; for (int i=0 ; i<4 ; ++i) { - if (!gn->m_sub || gn->m_sub->m_tok.m_type != Parser::TokenType::NumLiteral) + if (!gn || !gn->m_sub || gn->m_sub->m_tok.m_type != Parser::TokenType::NumLiteral) { opt = false; break;