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

Assert in as_bytecode.cpp AddPath()

Started by
2 comments, last by iraxef 10 years, 1 month ago

My application registers the following script function:

RegisterGlobalFunction("void yield()", asFUNCTION(yield), asCALL_CDECL)

When someone accidentally wrote the following script:


// meant to type this:
// yield();

// typed this:
yield;

they got the following assert:


assertion=instr->stackSize == stackSize
file=as_bytecode.cpp 241
function=void asCByteCode::AddPath(asCArray<asCByteInstruction*>&, asCByteInstruction*, int)

asCByteCode::Finalize(asCArray<int> const&)
asCCompiler::FinalizeFunction()
asCCompiler::CompileFunction(asCBuilder*, asCScriptCode*, asCArray<asCString>&, asCScriptNode*, asCScriptFunction*, sClassDeclaration*)
asCBuilder::Build()
asCModule::Build()

I'm going to try to reproduce this in a standalone program, outside of my application.

AngelScript Version 2.29.0 WIP - 2014/04/27, rev 1912. 32bit linux

Thank you!

Advertisement

It's quite possible the expression

yield;

produces some invalid bytecode sequence. This expression doesn't make much sense, since you're taking the address of the function but not doing anything with it. It should in fact give a compiler error, and not even get to the asCByteCode::AddPath() call.

I'll look into this.

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 1943.

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

Thank you!

This topic is closed to new replies.

Advertisement