🎉 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!

Object handle and constructor with array argument triggers assert

Started by
3 comments, last by perost86 5 years ago

This simple script triggers an assert during compilation of the script:


class TestClass
{
  TestClass(array<int> arr)
  {
    this.arr = arr;
  }

  private array<int> arr;
}

void main()
{
  TestClass @t = TestClass({});
}

The assert triggered when main is called is:


as_compiler.cpp:6474: asUINT asCCompiler::ImplicitConversion(asCExprContext *, const asCDataType &, asCScriptNode *, EImplicitConv, bool, bool):
Assertion `ctx->type.dataType.GetTokenType() != ttUnrecognizedToken || ctx->type.dataType.IsNullHandle() || ctx->IsAnonymousInitList()' failed.

The call stack shows that asCCompiler::ImplicitConversion is called from asCCompiler::CompileConstructCall at as_compiler.cpp:10935, and it's only called when the constructor has exactly one argument. Working around the issue by adding another argument to the constructor works just fine.

Advertisement

Thanks for the bug report with the sample to reproduce the problem.

I'll 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

I've fixed this in revision 2588.

Regards,
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

9 minutes ago, WitchLord said:

I've fixed this in revision 2588.

Thanks! That does indeed fix the issue for me.

This topic is closed to new replies.

Advertisement