libeval_compiler: thou shalt not use strlen() on wxStrings. Works under Linux, doesn't work on OSX/MSVC...
This commit is contained in:
parent
cda155ca30
commit
ab17f4b7b5
|
@ -762,13 +762,13 @@ bool COMPILER::generateUCode( UCODE* aCode, CONTEXT* aPreflightContext )
|
||||||
if( !vref )
|
if( !vref )
|
||||||
{
|
{
|
||||||
msg.Printf( _( "Unrecognized item '%s'" ), itemName );
|
msg.Printf( _( "Unrecognized item '%s'" ), itemName );
|
||||||
reportError( CST_CODEGEN, msg, node->leaf[0]->srcPos - (int) strlen( itemName ) );
|
reportError( CST_CODEGEN, msg, node->leaf[0]->srcPos - (int) itemName.length() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( vref->GetType() == VT_PARSE_ERROR )
|
if( vref->GetType() == VT_PARSE_ERROR )
|
||||||
{
|
{
|
||||||
msg.Printf( _( "Unrecognized property '%s'" ), propName );
|
msg.Printf( _( "Unrecognized property '%s'" ), propName );
|
||||||
reportError( CST_CODEGEN, msg, node->leaf[1]->srcPos - (int) strlen( propName ) );
|
reportError( CST_CODEGEN, msg, node->leaf[1]->srcPos - (int) propName.length() );
|
||||||
}
|
}
|
||||||
|
|
||||||
node->leaf[0]->isVisited = true;
|
node->leaf[0]->isVisited = true;
|
||||||
|
@ -791,13 +791,13 @@ bool COMPILER::generateUCode( UCODE* aCode, CONTEXT* aPreflightContext )
|
||||||
if( !vref )
|
if( !vref )
|
||||||
{
|
{
|
||||||
msg.Printf( _( "Unrecognized item '%s'" ), itemName );
|
msg.Printf( _( "Unrecognized item '%s'" ), itemName );
|
||||||
reportError( CST_CODEGEN, msg, node->leaf[0]->srcPos - (int) strlen( itemName ) );
|
reportError( CST_CODEGEN, msg, node->leaf[0]->srcPos - (int) itemName.length() );
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString functionName = *node->leaf[1]->leaf[0]->value.str;
|
wxString functionName = *node->leaf[1]->leaf[0]->value.str;
|
||||||
auto func = aCode->CreateFuncCall( functionName );
|
auto func = aCode->CreateFuncCall( functionName );
|
||||||
|
|
||||||
libeval_dbg( 10, "emit func call: %s\n", (const char*) functionName.c_str() );
|
libeval_dbg( 10, "emit func call: %s\n", functionName );
|
||||||
|
|
||||||
if( !func )
|
if( !func )
|
||||||
{
|
{
|
||||||
|
@ -893,7 +893,7 @@ bool COMPILER::generateUCode( UCODE* aCode, CONTEXT* aPreflightContext )
|
||||||
if( !vref )
|
if( !vref )
|
||||||
{
|
{
|
||||||
msg.Printf( _( "Unrecognized item '%s'" ), *node->value.str );
|
msg.Printf( _( "Unrecognized item '%s'" ), *node->value.str );
|
||||||
reportError( CST_CODEGEN, msg, node->srcPos - (int) strlen( *node->value.str ) );
|
reportError( CST_CODEGEN, msg, node->srcPos - (int) node->value.str->length() );
|
||||||
}
|
}
|
||||||
|
|
||||||
node->SetUop( TR_UOP_PUSH_VALUE, std::move( vref ) );
|
node->SetUop( TR_UOP_PUSH_VALUE, std::move( vref ) );
|
||||||
|
|
Loading…
Reference in New Issue