Jump to content

  • Log In with Google      Sign In   
  • Create Account


- - - - -

asASSERT in file: as_compiller.cpp line: 675


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
9 replies to this topic

#1 FDsagizi   Members   -  Reputation: 514

Like
0Likes
Like

Posted 11 February 2013 - 04:25 AM

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, 11 February 2013 - 04:25 AM.


Sponsor:

#2 Andreas Jonsson   Moderators   -  Reputation: 3292

Like
0Likes
Like

Posted 11 February 2013 - 07:58 AM

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.


AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

#3 FDsagizi   Members   -  Reputation: 514

Like
0Likes
Like

Posted 15 February 2013 - 02:39 AM

Ok, but i need some time.



#4 FDsagizi   Members   -  Reputation: 514

Like
0Likes
Like

Posted 19 February 2013 - 03:11 AM

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, 19 February 2013 - 04:19 AM.


#5 FDsagizi   Members   -  Reputation: 514

Like
0Likes
Like

Posted 19 February 2013 - 04:32 AM

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, 19 February 2013 - 04:35 AM.


#6 Andreas Jonsson   Moderators   -  Reputation: 3292

Like
0Likes
Like

Posted 19 February 2013 - 07:03 AM

Thanks for providing the sample for reproducing the problem. I'll look into this and have it fixed as soon as possible.


AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

#7 Andreas Jonsson   Moderators   -  Reputation: 3292

Like
0Likes
Like

Posted 19 February 2013 - 06:08 PM

I've fixed this problem in revision 1564.

 

Thanks,

Andreas


AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

#8 FDsagizi   Members   -  Reputation: 514

Like
0Likes
Like

Posted 20 February 2013 - 04:19 AM

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 );
}
 

 



#9 Andreas Jonsson   Moderators   -  Reputation: 3292

Like
0Likes
Like

Posted 20 February 2013 - 06:25 AM

I'll look into it. Thanks.


AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

#10 Andreas Jonsson   Moderators   -  Reputation: 3292

Like
0Likes
Like

Posted 20 February 2013 - 03:47 PM

Fixed in revision 1566. Regards.


AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS