... | ... |
@@ -147,6 +147,8 @@ struct cli_bc_ctx { |
147 | 147 |
unsigned line; |
148 | 148 |
unsigned col; |
149 | 149 |
mpool_t *mpool; |
150 |
+ uint32_t numGlobals; |
|
151 |
+ uint8_t* globals; |
|
150 | 152 |
}; |
151 | 153 |
struct cli_all_bc; |
152 | 154 |
int cli_vm_execute(const struct cli_bc *bc, struct cli_bc_ctx *ctx, const struct cli_bc_func *func, const struct cli_bc_inst *inst); |
... | ... |
@@ -262,7 +262,15 @@ static always_inline struct stack_entry *pop_stack(struct stack *stack, |
262 | 262 |
x = *(uint_type(n)*)&(from)[(p)];\ |
263 | 263 |
TRACE_R(x) |
264 | 264 |
|
265 |
-#define READN(x, n, p) READNfrom(func->numBytes, values, x, n, p) |
|
265 |
+#define READN(x, n, p)\ |
|
266 |
+ do {\ |
|
267 |
+ if (p&0x80000000) {\ |
|
268 |
+ uint32_t pg = p&0x7fffffff;\ |
|
269 |
+ READNfrom(ctx->numGlobals, ctx->globals, x, n, p);\ |
|
270 |
+ } else {\ |
|
271 |
+ READNfrom(func->numBytes, values, x, n, p);\ |
|
272 |
+ }\ |
|
273 |
+ } while (0) |
|
266 | 274 |
|
267 | 275 |
#define READ1(x, p) READN(x, 8, p);\ |
268 | 276 |
x = x&1 |