Advertisement

BUG: Multiple Registration of template type.

Started by September 10, 2013 05:58 PM
1 comment, last by WitchLord 11 years, 2 months ago

When registering a specialized array type twice I get an ACCESS VIOLATION.

engine->RegisterObjectType("array<int32>", 0, asOBJ_REF);

engine->RegisterObjectType("array<int>", 0, asOBJ_REF);

as_scriptengine.cpp: 1699


// Was the template instance type created before?
if( templateInstanceTypes[templateInstanceTypes.GetLength()-1] == mostRecentTemplateInstanceType ||
    mostRecentTemplateInstanceType == dt.GetObjectType() )
    // TODO: Should have a better error message
    return ConfigError(asNOT_SUPPORTED, "RegisterObjectType", name, 0);

templateInstanceTypes has a length of 0, so templateInstanceTypes[-1] produces the error.

The following modification seems to correct the issue. Please confirm.


// Was the template instance type created before?
if( templateInstanceTypes.GetLength() == 0 ||
	templateInstanceTypes[templateInstanceTypes.GetLength()-1] == mostRecentTemplateInstanceType ||
    mostRecentTemplateInstanceType == dt.GetObjectType() )
    // TODO: Should have a better error message
    return ConfigError(asNOT_SUPPORTED, "RegisterObjectType", name, 0);

I'll look into this. Thanks for the report

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

Advertisement

This has been fixed in revision 1724.

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

This topic is closed to new replies.

Advertisement