Jump to content
  • Advertisement
Sign in to follow this  
GGLucas

Compiler assert hit in DeallocateVariable

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

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.

Share this post


Link to post
Share on other sites
Advertisement

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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!