Followers 0

## 3 posts in this topic

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

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!

1

##### Share on other sites

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.

0

##### Share on other sites

I've fixed this in revision 1943.

Thanks,

Andreas

0

Thank you!

0

## Create an account

Register a new account