Jump to content

  • Log In with Google      Sign In   
  • Create Account


- - - - -

Bug in 1.9.0 WIP 2 ?


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 abrken   Members   -  Reputation: 130

Like
0Likes
Like

Posted 26 August 2004 - 10:55 PM

To reproduce :
	m_pAsEngine = (asIScriptEngineXPN *)asCreateScriptEngine(ANGELSCRIPT_VERSION);

	CString csTmpCode = "void sdf(){}\nvoid sdf(){}";
	m_pAsEngine->AddScriptSection("toto", "zefunc", csTmpCode, csTmpCode.GetLength());
	m_pAsEngine->Build("toto", NULL);
Do you see the error in the script ? Yes, I have entered 2 time the same function (sdf) ! You get an assert caused by:
void asCBuilder::CompileFunctions()
at
functions[n]->script->ConvertPosToRowCol(functions[n]->node->tokenPos, &r, &c);
To solve this problem that I did get in my project but for different reasons (I was calling two times the AddScriptSection without calling the build in between those two calls), I have call the Discard methos of asIScriptEngine. Then another bug appears. To Reproduce :
	CString csTmpCode = "void sdf(){}";
	m_pAsEngine->AddScriptSection("toto", "zefunc", csTmpCode, csTmpCode.GetLength());
	m_pAsEngine->Build("toto", NULL);
	m_pAsEngine->Discard("toto");
You get an assert caused by :
void asCModule::Discard()
at
delete this;


Sponsor:

#2 Andreas Jonsson   Moderators   -  Reputation: 3226

Like
0Likes
Like

Posted 27 August 2004 - 05:34 AM

I'll look into these ASAP.

Thanks for the detailed reports, they will help me find the bugs faster.

I'm planning on having a new WIP release this weekend. The bug fixes will probably be in that one.
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: 3226

Like
0Likes
Like

Posted 27 August 2004 - 09:36 AM

I've found and fixed the bugs in 1.9.0 WIP 3.

For WIP 2 the bug fixes ought to be:

as_builder.cpp -> asCBuilder::RegisterScriptFunction() -> line 878:

change the "return -1;" to "break;"

as_module.cpp -> asCModule::Discard() -> line 131:

Exchange the complete function to the following:


void asCModule::Discard()
{
if( contextCount == 0 )
delete this;
else
isDiscarded = true;
}


I haven't tested those changes but I believe they should do the trick, as it is basically what I did in WIP 3. I've made too many other changes in WIP 3 to be sure without doing a complete test.

[Edited by - WitchLord on August 27, 2004 3:36:53 PM]
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 abrken   Members   -  Reputation: 130

Like
0Likes
Like

Posted 29 August 2004 - 08:08 PM

After the changes the result gives :

AddCharToCode (8, 1) : Error : A function with the same name and parameters already exist


The Discard function do not result in an assert anymore.

Thank's !

I did not test it on WIP 3 but WIP 2.




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