Don't fire non-well-formed rules. (But don't assert either.)

Fixes https://gitlab.com/kicad/code/kicad/issues/5443
This commit is contained in:
Jeff Young 2020-09-01 17:34:35 +01:00
parent f38631b9ab
commit a35698f08a
1 changed files with 6 additions and 1 deletions

View File

@ -1022,10 +1022,15 @@ void UOP::Exec( CONTEXT* ctx )
VALUE* UCODE::Run( CONTEXT* ctx )
{
static VALUE g_false( 0 );
for( UOP* op : m_ucode )
op->Exec( ctx );
assert( ctx->SP() == 1 );
// non-well-formed rules should not be fired
if( ctx->SP() != 1 )
return &g_false;
return ctx->Pop();
}