Skip to content

Commit 6749f9e

Browse files
committed
various fixes
1 parent 0a31103 commit 6749f9e

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

src/jit_dump.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ static void dump_value( jit_ctx *ctx, uint64 value, emit_mode mode ) {
222222
default:
223223
if( value == 0 )
224224
printf("NULL");
225-
else if( mode == M_PTR && value >= (uint64)code->types && value < (uint64)(code->types + code->ntypes) )
225+
else if( mode == M_PTR && value >= (uint64)code->types && value < (uint64)(code->types + code->ntypes) && (((char*)value-(char*)code->types) % sizeof(hl_type)) == 0 )
226226
uprintf(USTR("<%s>"),hl_type_str((hl_type*)value));
227227
else if( mode == M_PTR && value == (uint64)mod->globals_data )
228228
printf("<globals>");

src/jit_emit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1708,7 +1708,7 @@ static void emit_opcode( emit_ctx *ctx, hl_opcode *o ) {
17081708
STORE_MEM(field, 0, val);
17091709
int jend = emit_jump(ctx, false);
17101710
patch_jump(ctx, jidx);
1711-
bool need_type = dyn_need_type(dst->t);
1711+
bool need_type = dyn_need_type(rb->t);
17121712
ereg args[4];
17131713
args[0] = obj;
17141714
args[1] = LOAD_CONST(dst->t->virt->fields[o->p2].hashed_name,&hlt_i32);
@@ -1718,7 +1718,7 @@ static void emit_opcode( emit_ctx *ctx, hl_opcode *o ) {
17181718
} else {
17191719
args[2] = val;
17201720
}
1721-
emit_native_call(ctx,get_dynset(dst->t),args,need_type?4:3,dst->t);
1721+
emit_native_call(ctx,get_dynset(rb->t),args,need_type?4:3,dst->t);
17221722
patch_jump(ctx, jend);
17231723
}
17241724
break;

src/jit_regs.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,13 @@ void hl_regs_function( jit_ctx *jit ) {
766766
v->mode = M_NONE;
767767
}
768768
}
769+
for(int b=0;b<jit->block_count;b++) {
770+
eblock *bl = jit->blocks + b;
771+
for(int p=0;p<bl->phi_count;p++) {
772+
ephi *ph = bl->phis + p;
773+
VAL_REG(ph->value)->mode = ph->mode;
774+
}
775+
}
769776
regs_compute_liveness(ctx);
770777
regs_assign_regs(ctx);
771778
regs_emit_instrs(ctx);

0 commit comments

Comments
 (0)