• Advertisement
Sign in to follow this  

asASSERT in file: as_compiller.cpp line: 675

This topic is 1798 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi smile.png

 

I update from svn to new version, and i have asserts on debug compilation! But last version compilated with out asserts!

 

If i comment code: 

 

 

 

    // At this point there should be no variables allocated
    //asASSERT(variableAllocations.GetLength() == freeVariables.GetLength());
 

 

 
Then compilate ok, and work fine!
Edited by FDsagizi

Share this post


Link to post
Share on other sites
Advertisement

Can you show me the script function that is being compiled when you get the assert failure? The compiler is doing something wrong if this assert failure triggers and I must fix it. 

 

I don't get this error in any of my tests though, so you have a very specific scenario that is not covered by my tests.

Share this post


Link to post
Share on other sites
i find this strange bug, problem show as we use "string" and "if"

this code compilate, and work normal
void SetTexture( string txt ){}

void startGame( string &type )
{
    //if(false) SetTexture( "");


    string set_text = "hello world"; 
    output( "1 "  );
    output( "2 " + set_text );
    output( "3 "  );
} 

output:
 

1
2 hello world
3

this code work not correct in release, and in debug asserted
void SetTexture( string txt ){}

void startGame( string &type )
{
    if(false) SetTexture( "");

    string set_text = "hello world"; 
    output( "1 "  );
    output( "2 " + set_text );
    output( "3 "  );
}  
in release result:

1

3

i use my string class, register as:
r=en->RegisterObjectType("string", sizeof(Str), asOBJ_VALUE | asOBJ_APP_CLASS_CDAK); assert( r >= 0 );
r=en->RegisterObjectBehaviour("string", asBEHAVE_CONSTRUCT, "void f()", asFUNCTION(ConstructStr), asCALL_CDECL_OBJLAST); assert( r >= 0 );
r=en->RegisterObjectBehaviour("string", asBEHAVE_CONSTRUCT, "void f(const string &)", asFUNCTION(CopyConstructStr), asCALL_CDECL_OBJLAST); assert( r >= 0 );
r=en->RegisterObjectBehaviour("string", asBEHAVE_DESTRUCT, "void f()", asFUNCTION(DestructStr), asCALL_CDECL_OBJLAST); assert( r >= 0 );

r=en->RegisterStringFactory("string", asFUNCTION( StrFactory ), asCALL_CDECL); assert( r >= 0 );
 
Edited by FDsagizi

Share this post


Link to post
Share on other sites

So you can see the problem, replace it:
 
scriptstdstring.cpp
 
 
 

r = engine->RegisterObjectBehaviour("string", asBEHAVE_CONSTRUCT,  "void f(const string &in)",    asFUNCTION(CopyConstructString), asCALL_CDECL_OBJLAST); 
assert( r >= 0 );

to:

r = engine->RegisterObjectBehaviour("string", asBEHAVE_CONSTRUCT,  "void f(const string &)",    asFUNCTION(CopyConstructString), asCALL_CDECL_OBJLAST); assert( r >= 0 );
 

 

eg. "&in" to "&" and set flag to engine asEP_ALLOW_UNSAFE_REFERENCES - true
 
and compilate this code

 

void SetTexture( string txt ){}

void startGame( string &type )
{
         if(false) SetTexture( "");
}
 
Edited by FDsagizi

Share this post


Link to post
Share on other sites

Goood!smile.png

 

I do not want to create a new topic, a small compiler error - if use not difination enum:

 

file: as_compiler.cpp line: 7060

 

script code exemple:

 

 

 

 

enum SomeEnum{    
    en_A 
}
int GetVal( SomeEnum some ){
    return 0;
}
class B
{
    int some_val = GetVal( en_B );
}
 

 

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement