...
|
...
|
@@ -29,6 +29,9 @@
|
29
|
29
|
#include "type_desc.h"
|
30
|
30
|
#include "readdb.h"
|
31
|
31
|
#include <string.h>
|
|
32
|
+#ifndef _WIN32
|
|
33
|
+#include <sys/time.h>
|
|
34
|
+#endif
|
32
|
35
|
|
33
|
36
|
/* Enable this to catch more bugs in the RC phase */
|
34
|
37
|
#define CL_BYTECODE_DEBUG
|
...
|
...
|
@@ -594,12 +597,14 @@ int cli_vm_execute(const struct cli_bc *bc, struct cli_bc_ctx *ctx, const struct
|
594
|
594
|
memset(&ptrinfos, 0, sizeof(ptrinfos));
|
595
|
595
|
memset(&stack, 0, sizeof(stack));
|
596
|
596
|
for (i=0;i < cli_apicall_maxglobal - _FIRST_GLOBAL; i++) {
|
|
597
|
+ void *apiptr;
|
|
598
|
+ uint32_t size;
|
597
|
599
|
const struct cli_apiglobal *g = &cli_globals[i];
|
598
|
600
|
void **apiglobal = (void**)(((char*)ctx) + g->offset);
|
599
|
601
|
if (!apiglobal)
|
600
|
602
|
continue;
|
601
|
|
- void *apiptr = *apiglobal;
|
602
|
|
- uint32_t size = globaltypesize(g->type);
|
|
603
|
+ apiptr = *apiglobal;
|
|
604
|
+ size = globaltypesize(g->type);
|
603
|
605
|
ptr_register_glob_fixedid(&ptrinfos, apiptr, size, g->globalid - _FIRST_GLOBAL+1);
|
604
|
606
|
}
|
605
|
607
|
ptr_register_glob_fixedid(&ptrinfos, bc->globalBytes, bc->numGlobalBytes,
|
...
|
...
|
@@ -1094,7 +1099,7 @@ int cli_vm_execute(const struct cli_bc *bc, struct cli_bc_ctx *ctx, const struct
|
1094
|
1094
|
gettimeofday(&tv1, NULL);
|
1095
|
1095
|
tv1.tv_sec -= tv0.tv_sec;
|
1096
|
1096
|
tv1.tv_usec -= tv0.tv_usec;
|
1097
|
|
- cli_dbgmsg("intepreter bytecode run finished in %dus\n",
|
|
1097
|
+ cli_dbgmsg("intepreter bytecode run finished in %luus\n",
|
1098
|
1098
|
tv1.tv_sec*1000000 + tv1.tv_usec);
|
1099
|
1099
|
}
|
1100
|
1100
|
|