void asCScriptEngine::CallObjectMethod(...)
{
.....f(obj, param); // <- line 3373 - causes segmentation fault
}
"f" comes out with some weird value.
This function is being called by the asCScriptEngine::WriteMessage(...). I'm registering my callback function like this:
void scriptInterface::setMessageCallback(asIScriptEngine* compiler)
{
compiler->SetMessageCallback( asMETHOD(scriptInterface,MessageCallback),this,asCALL_THISCALL );
}
virtual void scriptInterface::MessageCallback(const asSMessageInfo *msg)
{
// Implement a simple message callback function
const char *type = "ERR ";
if( msg->type == asMSGTYPE_WARNING )
type = "WARN";
else if( msg->type == asMSGTYPE_INFORMATION )
type = "INFO";
printf("%s (%d, %d) : %s : %s\n", msg->section, msg->row, msg->col, type, msg->message);
}
I have the feeling that the problem is here (file angelscript.h line 1024)
// Template specialization
template <>
struct asSMethodPtr<SINGLE_PTR_SIZE>
{
template<class M>
static asSFuncPtr Convert(M Mthd)
{
asSFuncPtr p;
asMemClear(&p, sizeof(p));
asMemCopy(&p, &Mthd, SINGLE_PTR_SIZE); //<- after this, "f" (inside "p") gets wrong value
// Mark this as a class method
p.flag = 3;
return p;
}
};
To make things even weirder, everything works as expected under Windows XP. I'm getting this error under Linux (Ubuntu) - using Code::Blocks as IDE.
Any ideas?
Carlos






