Jump to content

  • Log In with Google      Sign In   
  • Create Account


- - - - -

Assert in as_bytecode.cpp AddPath()


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 iraxef   Members   -  Reputation: 317

Like
1Likes
Like

Posted 26 May 2014 - 08:02 PM

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!



Sponsor:

#2 Andreas Jonsson   Moderators   -  Reputation: 3261

Like
0Likes
Like

Posted 27 May 2014 - 02:59 PM

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

#3 Andreas Jonsson   Moderators   -  Reputation: 3261

Like
0Likes
Like

Posted 28 May 2014 - 07:26 PM

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

#4 iraxef   Members   -  Reputation: 317

Like
0Likes
Like

Posted 28 May 2014 - 08:02 PM

Thank you!






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS