Sign in to follow this  

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

This topic is 1056 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

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.

Share this post


Link to post
Share on other sites

This topic is 1056 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this