libeval_compiler: fix crash when preflighting method calls with 0 arguments
This commit is contained in:
parent
8a5297180e
commit
712215fe12
|
@ -805,11 +805,17 @@ bool COMPILER::generateUCode( UCODE* aCode, CONTEXT* aPreflightContext )
|
||||||
if( func )
|
if( func )
|
||||||
{
|
{
|
||||||
// Preflight the function call
|
// Preflight the function call
|
||||||
wxString paramStr = *node->leaf[1]->leaf[1]->value.str;
|
auto argsLeaf = node->leaf[1]->leaf[1];
|
||||||
VALUE* param = aPreflightContext->AllocValue();
|
wxString paramStr;
|
||||||
|
|
||||||
param->Set( paramStr );
|
if( argsLeaf->op != TR_NULL ) // function has an argument
|
||||||
aPreflightContext->Push( param );
|
{
|
||||||
|
paramStr = *node->leaf[1]->leaf[1]->value.str;
|
||||||
|
VALUE* param = aPreflightContext->AllocValue();
|
||||||
|
|
||||||
|
param->Set( paramStr );
|
||||||
|
aPreflightContext->Push( param );
|
||||||
|
}
|
||||||
|
|
||||||
aPreflightContext->SetErrorCallback(
|
aPreflightContext->SetErrorCallback(
|
||||||
[&]( const wxString& aMessage, int aOffset )
|
[&]( const wxString& aMessage, int aOffset )
|
||||||
|
|
Loading…
Reference in New Issue