...
|
...
|
@@ -68,7 +68,6 @@ static inline int bcfail(const char *msg, long a, long b,
|
68
|
68
|
#define CHECK_EQ(a,b)
|
69
|
69
|
#define CHECK_GT(a,b)
|
70
|
70
|
#endif
|
71
|
|
-
|
72
|
71
|
#ifdef CL_DEBUG
|
73
|
72
|
#define CHECK_UNREACHABLE do { cli_dbgmsg("bytecode: unreachable executed!\n"); return CL_EBYTECODE; } while(0)
|
74
|
73
|
#define TRACE_R(x) cli_dbgmsg("bytecode trace: %u, read %llx\n", pc, (long long)x);
|
...
|
...
|
@@ -287,7 +286,11 @@ static always_inline struct stack_entry *pop_stack(struct stack *stack,
|
287
|
287
|
do {\
|
288
|
288
|
if (p&0x80000000) {\
|
289
|
289
|
uint32_t pg = p&0x7fffffff;\
|
|
290
|
+ if (!pg) {\
|
|
291
|
+ x = 0;\
|
|
292
|
+ } else {\
|
290
|
293
|
READNfrom(bc->numGlobalBytes, bc->globalBytes, x, n, pg);\
|
|
294
|
+ }\
|
291
|
295
|
} else {\
|
292
|
296
|
READNfrom(func->numBytes, values, x, n, p);\
|
293
|
297
|
}\
|
...
|
...
|
@@ -539,6 +542,8 @@ static inline int64_t ptr_register_glob_fixedid(struct ptr_infos *infos,
|
539
|
539
|
static inline int64_t ptr_register_glob(struct ptr_infos *infos,
|
540
|
540
|
void *values, uint32_t size)
|
541
|
541
|
{
|
|
542
|
+ if (!values)
|
|
543
|
+ return 0;
|
542
|
544
|
return ptr_register_glob_fixedid(infos, values, size, infos->nglobs+1);
|
543
|
545
|
}
|
544
|
546
|
|
...
|
...
|
@@ -876,7 +881,7 @@ int cli_vm_execute(const struct cli_bc *bc, struct cli_bc_ctx *ctx, const struct
|
876
|
876
|
int32_t resp;
|
877
|
877
|
READ32(arg2, inst->u.ops.ops[1]);
|
878
|
878
|
READP(arg1, inst->u.ops.ops[0], arg2);
|
879
|
|
- READ32(arg3, inst->u.ops.ops[3]);
|
|
879
|
+ READ32(arg3, inst->u.ops.ops[2]);
|
880
|
880
|
resp = cli_apicalls9[api->idx](ctx, arg1, arg2, arg3);
|
881
|
881
|
WRITE32(inst->dest, resp);
|
882
|
882
|
break;
|