From 17d3e36bd6492ad8e16cf4a93daac8c81d121917 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 12 Aug 2020 12:36:40 +0100 Subject: [PATCH] Fix crash bug when condition expression is empty. --- common/libeval_compiler/libeval_compiler.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/libeval_compiler/libeval_compiler.cpp b/common/libeval_compiler/libeval_compiler.cpp index 139e378846..c322ef7416 100644 --- a/common/libeval_compiler/libeval_compiler.cpp +++ b/common/libeval_compiler/libeval_compiler.cpp @@ -626,7 +626,12 @@ bool COMPILER::generateUCode( UCODE* aCode, CONTEXT* aPreflightContext ) 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 );