Fix crash bug when condition expression is empty.

This commit is contained in:
Jeff Young 2020-08-12 12:36:40 +01:00
parent 9057a46a20
commit 17d3e36bd6
1 changed files with 6 additions and 1 deletions

View File

@ -626,7 +626,12 @@ bool COMPILER::generateUCode( UCODE* aCode, CONTEXT* aPreflightContext )
return visitedNodes.find( node ) != visitedNodes.end(); return visitedNodes.find( node ) != visitedNodes.end();
}; };
assert( m_tree ); if( !m_tree )
{
// Empty expression returns true
aCode->AddOp( makeUop( TR_UOP_PUSH_VALUE, 1.0 ) );
return true;
}
stack.push_back( m_tree ); stack.push_back( m_tree );