big FIXME

svn-id: r9221
This commit is contained in:
Max Horn 2003-07-28 02:39:40 +00:00
parent 544168e96b
commit d4933386a9

View File

@ -325,6 +325,12 @@ int RunScript ( const char * scriptData , char * objectData , uint32 *offset )
// Get the start of variables and start of code
DEBUG3("Enter interpreter data %x, object %x, offset %d",scriptData,objectData,*offset);
// FIXME: The following is a fundamental (?) flaw in the code.
// Both "variables" and "scriptData" are const pointers. However,
// later the code actually writes code into "variables". Both can't
// be the case at the same time. Either the const qualifiers have
// to be removed, or the writes to *variables are bogus.
const char *variables = scriptData + sizeof(int);
const char *code = scriptData + *((int *)scriptData) + sizeof(int);
uint32 noScripts = *((int32 *)code);