Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#Actualsimong

Posted 28 February 2014 - 03:58 AM

I tried the rev 1858 (and the release 2.28.0 & 2.28.1) and unfortunately it doesn't change anything. 

 

I also tried several combination of asOBJ_APP_CLASS_* without any luck, but I did find that it doesn't reach the assertion failed if the type is declared only as asOBJ_VALUE | asOBJ_POD.

 

I tried to make a test as short as possible that still make the application crash:

    // Register the class itself
    r = engine->RegisterObjectType( "Vec2f", sizeof(Vec2f_), asOBJ_VALUE | asOBJ_APP_CLASS_CDAK ); assert( r >= 0 );
    
    
    // Vec2f()
    r = engine->RegisterObjectBehaviour( "Vec2f", asBEHAVE_CONSTRUCT, "void f()",
                                        asFUNCTION(as::BindingHelper::constructor<Vec2f_>),
                                        asCALL_CDECL_OBJLAST); assert( r >= 0 );
    // Vec2f( const Vec2f& src )
    r = engine->RegisterObjectBehaviour( "Vec2f", asBEHAVE_CONSTRUCT, "void f(const Vec2f &in )",
                                        asFUNCTION((as::BindingHelper::constructor<Vec2f_,Vec2f_&>)),
                                        asCALL_CDECL_OBJLAST); assert( r >= 0 );
    
    // ~Vec2f()
    r = engine->RegisterObjectBehaviour("Vec2f", asBEHAVE_DESTRUCT, "void f()",
                                        asFUNCTION(as::BindingHelper::destructor<Vec2f_>),
                                        asCALL_CDECL_OBJLAST); assert( r >= 0 );
    
    // Vec2f& operator=( const Vec2f& rhs )
    r = engine->RegisterObjectMethod("Vec2f", "Vec2f opAssign(const Vec2f &in)",
                                     asFUNCTION((as::BindingHelper::opAssign<Vec2f_,Vec2f_,Vec2f_>)),
                                     asCALL_CDECL_OBJLAST); assert( r >= 0 );

I replaced the original Vec2f class by a dummy one just to be sure (the original class contains all the functions registered above):

class Vec2f_ {
    
};

And here's the script:

Vec2f t;

void main(){
    test( t );
}

void test( const Vec2f &in v ){}

The "as::BindingHelper" above is using the exact same code as the class helper that you can find on the wiki.

 

Here's the full callstack if it's of any help:

 

Screen%20Shot%202014-02-28%20at%2010.55.


#1simong

Posted 28 February 2014 - 03:42 AM

I tried the rev 1858 (and the release 2.28.0 & 2.28.1) and unfortunately it doesn't change anything. 

 

I also tried several combination of asOBJ_APP_CLASS_* without any luck, but I did find that it doesn't reach the assertion failed if the type is declared only as asOBJ_VALUE | asOBJ_POD.

 

I tried to make a test as short as possible that still make the application crash:

    // Register the class itself
    r = engine->RegisterObjectType( "Vec2f", sizeof(Vec2f_), asOBJ_VALUE | asOBJ_APP_CLASS_CDAK ); assert( r >= 0 );
    
    
    // Vec2f()
    r = engine->RegisterObjectBehaviour( "Vec2f", asBEHAVE_CONSTRUCT, "void f()",
                                        asFUNCTION(as::BindingHelper::constructor<Vec2f_>),
                                        asCALL_CDECL_OBJLAST); assert( r >= 0 );
    // Vec2f( const Vec2f& src )
    r = engine->RegisterObjectBehaviour( "Vec2f", asBEHAVE_CONSTRUCT, "void f(const Vec2f &in )",
                                        asFUNCTION((as::BindingHelper::constructor<Vec2f_,Vec2f_&>)),
                                        asCALL_CDECL_OBJLAST); assert( r >= 0 );
    
    // ~Vec2f()
    r = engine->RegisterObjectBehaviour("Vec2f", asBEHAVE_DESTRUCT, "void f()",
                                        asFUNCTION(as::BindingHelper::destructor<Vec2f_>),
                                        asCALL_CDECL_OBJLAST); assert( r >= 0 );
    
    // Vec2f& operator=( const Vec2f& rhs )
    r = engine->RegisterObjectMethod("Vec2f", "Vec2f opAssign(const Vec2f &in)",
                                     asFUNCTION((as::BindingHelper::opAssign<Vec2f_,Vec2f_,Vec2f_>)),
                                     asCALL_CDECL_OBJLAST); assert( r >= 0 );

I replaced the original Vec2f class by a dummy one just to be sure (the original class contains all the functions registered above):

class Vec2f_ {
    
};

And here's the script:

Vec2f t;

void main(){
    test( t );
}

void test( const Vec2f &in v ){}

The "as::BindingHelper" above is using the exact same code as the class helper that you can find on the wiki.


PARTNERS