🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Virtual property compound assignment on temporary object handle (v2.30.0)

Started by
1 comment, last by WitchLord 9 years, 4 months ago

Just downloaded v2.30.0 for the virtual property compound assignment, and it's mostly great but there does seem to be an issue. Here's a snippet of the registration:


ASengine->RegisterObjectType("jjOBJ", sizeof(Omonster), asOBJ_REF | asOBJ_NOCOUNT );
ASengine->RegisterObjectMethod("jjOBJ", "uint16 get_creatorID() const", asFUNCTION(getCreatorID), asCALL_CDECL_OBJFIRST);
ASengine->RegisterObjectMethod("jjOBJ", "uint16 set_creatorID(uint16)", asFUNCTION(setCreatorID), asCALL_CDECL_OBJFIRST);
ASengine->RegisterGlobalFunction("jjOBJ @get_jjObjects(int)", asFUNCTION(getObject), asCALL_CDECL);

Given that, any of these run fine:


    jjObjects[0].creatorID = jjObjects[0].creatorID + 2;
//or
    jjOBJ@ obj = jjObjects[0];
    obj.creatorID = obj.creatorID + 2;
//or
    jjOBJ@ obj = jjObjects[0];
    obj.creatorID += 2;

But either of these versions produce a Null Pointer Access exception:


    jjObjects[0].creatorID += 2;
//or
    get_jjObjects(0).creatorID += 2;

The problem seems to exist for any function that returns a handle, even ones that aren't registered as get_*; that was just the easiest one to test given my existing registration. If creatorID is registered with RegisterObjectProperty instead, nothing goes wrong.

Advertisement

Thanks for the report. I'll look into it.

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

I've fixed this bug in revision 2137.

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

This topic is closed to new replies.

Advertisement