Skip to content

Commit f8ec379

Browse files
committed
Update jit signedness
1 parent 1c2fff0 commit f8ec379

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

rsrc/font10x15/invert.font10x15.png

0 Bytes
Loading

src/cjit.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ static int pre_insn_hook(struct sim_state *s, const struct element *i, void *ud)
4545
if (bb->run_count == o->js->run_count_threshold) {
4646
// Cache the instructions we receive so they are ready for compilation
4747
if (!bb->cache)
48-
bb->cache = calloc(bb->len, sizeof *bb->cache);
48+
bb->cache = calloc((size_t)bb->len, sizeof *bb->cache);
4949
bb->cache[i->insn.reladdr - bb->base] = i->insn.u.word;
5050
} else if (bb->run_count > o->js->run_count_threshold) {
5151
bb->compiled = jit_gen_block(o->js, bb->len, bb->cache);
@@ -100,7 +100,7 @@ int jit_run_sim(struct sim_state *s, const struct run_ops *ops, void **run_data,
100100
do {
101101
if (o->curr_bb && o->curr_bb->compiled) {
102102
o->curr_bb->compiled(s, s->machine.regs);
103-
s->insns_executed += o->curr_bb->len;
103+
s->insns_executed += (unsigned long)o->curr_bb->len;
104104
o->curr_bb->run_count++;
105105
o->curr_bb = NULL;
106106
}

src/jit.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ struct basic_block {
3131
int32_t *cache;
3232
int run_count;
3333
int32_t base;
34-
uint32_t len;
34+
int len;
3535
};
3636

3737
void jit_init(struct jit_state **state);

0 commit comments

Comments
 (0)