Skip to main content
GameDev.net gamedev.net
🔒 Locked

Compiler assert hit in DeallocateVariable

Started by GGLucas Feb 19, 2016 at 10:52 PM 1 replies 1.8k views
Original Post
GGLucas
GGLucas

Hi, I've been working on updating to the svn build of AS, and I'm getting an assertion failure in asCCompiler::DeallocateVariable. It triggers when I use code like this:


class A {
	A() {}
	A(A@ other) {}
};

class B {
	B(A@ a) {
		A x(a);
	}
};

Which causes asASSERT(offset == 0x7FFF) to fail.

I commented out the assert and everything seems to be working fine, so I'm assuming for now that the assert is wrong. I do have some local changes to the angelscript source, but nothing that I can see that would cause this, so I'm hoping you're able to reproduce it. svn commit used is 2292.

WitchLord
WitchLord

Thanks for the bug report.

I've reproduced the problem, and will need investigate the cause and fix it.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - <a href="http://www.angelcode.com/tower" rel
WitchLord
WitchLord

I've fixed this bug in revision 2293.

The assert was correct. The problem was in how the compiler had prepared the argument for the A constructor call. With the bytecode sequence that was produced the content of the parameter a would be cleared with the statement 'A x(a)'. In your case it didn't cause any problem since you didn't use a afterwards, but if you had you would get a null pointer exception.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - <a href="http://www.angelcode.com/tower" rel

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.