variable allocation assert
Hi Andreas, Long time no speak, angelscript has been working beautifully for us for the last 4 years, can't believe how active you still are on the development front. I'm so glad I didn't stick with lua back in 2005. :D I've just installed 2.17.0 in the hope that I can use the class and method iteration routines to auto*magically* generate some html api docs for user reference. I'm planning on doing something similar to javadoc/doxygen commenting to allow methods and params to be annotated. I'm upgrading from 2.12.0, so I'm using a few deprecated angelscript api calls as a first cut to the migration. I'm having a problem with as_compiler::CompileFunction on line 473: asASSERT(variableAllocations.GetLength() == freeVariables.GetLength()); After trawling the forums, I've found a few past threads about this, but unfortunately I'm nowhere near the point where I can produce a repeatable test because the function being called is a mammoth 2000 lines long :) I'm considering whether I should use an old version (somewhere between 2.12.0 and 2.17.0) to satisfy my new use-case. Have you got any suggestions re: which version would get me there? Cheers, Pratty
Yes, it's been 6.5 years since I started working on AngelScript and I'm still working steadily on new features. :)
Version 2.13.0 added the methods for enumerating methods and properties in objects. But it was only in 2.16.0 that I added the methods to enumerate everything in the engine.
I really recommend you go with 2.17.0 despite the bug you came across. Chances are that this bug was introduced in earlier versions so choosing a lower version may not help, and you would still have to live with the other bugs that have been fixed in more recent versions. Besides, upgrading to 2.17.0 now will make it easier to upgrade to newer versions in the future.
If you can just help me find a script that reproduces the problem I'll make sure to have the bug fixed as soon as possible. Try commenting out parts of the script function and recompile it to see if the assert failure remains. If you eliminate approximately half of the code each step it shouldn't take more than a few iterations to narrow it down.
Even if you do choose to use an earlier version, I hope you'll have the time to help me determine the bug in the current version. I would hate to have to ignore this bug due to lack of information.
Regards,
Andreas
Version 2.13.0 added the methods for enumerating methods and properties in objects. But it was only in 2.16.0 that I added the methods to enumerate everything in the engine.
I really recommend you go with 2.17.0 despite the bug you came across. Chances are that this bug was introduced in earlier versions so choosing a lower version may not help, and you would still have to live with the other bugs that have been fixed in more recent versions. Besides, upgrading to 2.17.0 now will make it easier to upgrade to newer versions in the future.
If you can just help me find a script that reproduces the problem I'll make sure to have the bug fixed as soon as possible. Try commenting out parts of the script function and recompile it to see if the assert failure remains. If you eliminate approximately half of the code each step it shouldn't take more than a few iterations to narrow it down.
Even if you do choose to use an earlier version, I hope you'll have the time to help me determine the bug in the current version. I would hate to have to ignore this bug due to lack of information.
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
I've done some more digging around and the problem is with using assignment operators. I'm using the AS_DEPRECATED preprocessor at the moment, so I'm not sure if your unit tests maybe only test the non-deprecated version. The deallocation code in the as_compiler is deallocating 1 additional temporary variable that hasn't been accounted for during allocation.
Sorry, I haven't got any repeatable source code to use for the test yet, but here's the general recipe:
1.) create a CDA class (Constructor-Destructor-Assignment Operator), registering each of the object behaviours with angelscript.
2.) compile a script using the assignment operator syntax.
MyClass c = MyClass();
That should be enough to trigger the assert.
If I change the script to copy constructor notation, ala:
MyClass c();
the assert is avoided.
Hopefully, I can migrate across to the non-deprecated version of 2.17.0, because the users aren't c++ coders, and so I'd rather not inflict copy constructor syntax on them for now :D
Regards,
Andrew
Sorry, I haven't got any repeatable source code to use for the test yet, but here's the general recipe:
1.) create a CDA class (Constructor-Destructor-Assignment Operator), registering each of the object behaviours with angelscript.
2.) compile a script using the assignment operator syntax.
MyClass c = MyClass();
That should be enough to trigger the assert.
If I change the script to copy constructor notation, ala:
MyClass c();
the assert is avoided.
Hopefully, I can migrate across to the non-deprecated version of 2.17.0, because the users aren't c++ coders, and so I'd rather not inflict copy constructor syntax on them for now :D
Regards,
Andrew
This thread can probably help you with the upgrade.
I'm pretty sure the assert failure is in the deprecated code, as the example you mentioned is not causing any problems in the current code. I'd prefer not to have to work on the deprecated code, but if you really need it let me know and I'll take a closer look.
I'm pretty sure the assert failure is in the deprecated code, as the example you mentioned is not causing any problems in the current code. I'd prefer not to have to work on the deprecated code, but if you really need it let me know and I'll take a closer look.
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
Great, thanks for the link, that will be handy.
Yeah, I wouldn't worry too much about the deprecated code. I'm out of action for a few weeks on this stuff (flitting between jobs), but I'll probably get back on to the migration work in late September. I'll give an update then.
Thanks for the pointers,
Pratty
Yeah, I wouldn't worry too much about the deprecated code. I'm out of action for a few weeks on this stuff (flitting between jobs), but I'll probably get back on to the migration work in late September. I'll give an update then.
Thanks for the pointers,
Pratty
Hi Andreas,
Ok, I've got the migration to the 2.17.x api working, and the variable allocation assert issue has gone away, so its a problem with the deprecated version as we thought.
Cheers,
Pratty
[Edited by - pratty on September 29, 2009 6:32:07 PM]
Ok, I've got the migration to the 2.17.x api working, and the variable allocation assert issue has gone away, so its a problem with the deprecated version as we thought.
Cheers,
Pratty
[Edited by - pratty on September 29, 2009 6:32:07 PM]
Thanks for confirming this for me. Hope you like the new features of 2.17.0. :)
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
Popular Topics
Advertisement
Recommended Tutorials
Advertisement