diff --git a/dynasm/dasm_proto.h b/dynasm/dasm_proto.h index 3e77f70b..114f0fb8 100644 --- a/dynasm/dasm_proto.h +++ b/dynasm/dasm_proto.h @@ -29,9 +29,6 @@ /* Internal DynASM encoder state. */ typedef struct dasm_State dasm_State; -/* Action list type. */ -typedef const unsigned char *dasm_ActList; - /* Initialize and free DynASM state. */ DASM_FDEF void dasm_init(Dst_DECL, int maxsection); @@ -44,7 +41,7 @@ DASM_FDEF void dasm_setupglobal(Dst_DECL, void **gl, unsigned int maxgl); DASM_FDEF void dasm_growpc(Dst_DECL, unsigned int maxpc); /* Setup encoder. */ -DASM_FDEF void dasm_setup(Dst_DECL, dasm_ActList actionlist); +DASM_FDEF void dasm_setup(Dst_DECL, const void *actionlist); /* Feed encoder with actions. Calls are generated by pre-processor. */ DASM_FDEF void dasm_put(Dst_DECL, int start, ...); diff --git a/dynasm/dasm_x86.h b/dynasm/dasm_x86.h index a1f08896..517ee4f6 100644 --- a/dynasm/dasm_x86.h +++ b/dynasm/dasm_x86.h @@ -47,6 +47,9 @@ enum { #define DASM_POS2SEC(pos) ((pos)>>24) #define DASM_POS2PTR(D, pos) (D->sections[DASM_POS2SEC(pos)].rbuf + (pos)) +/* Action list type. */ +typedef const unsigned char *dasm_ActList; + /* Per-section structure. */ typedef struct dasm_Section { int *rbuf; /* Biased buffer pointer (negative section bias). */ @@ -132,11 +135,11 @@ void dasm_growpc(Dst_DECL, unsigned int maxpc) } /* Setup encoder. */ -void dasm_setup(Dst_DECL, dasm_ActList actionlist) +void dasm_setup(Dst_DECL, const void *actionlist) { dasm_State *D = Dst_REF; int i; - D->actionlist = actionlist; + D->actionlist = (dasm_ActList)actionlist; D->status = DASM_S_OK; D->section = &D->sections[0]; memset((void *)D->lglabels, 0, D->lgsize); diff --git a/src/buildvm.c b/src/buildvm.c index 8cceeb23..817d4bc4 100644 --- a/src/buildvm.c +++ b/src/buildvm.c @@ -189,7 +189,7 @@ static int build_code(BuildCtx *ctx) ctx->npc = build_backend(ctx); /* Finalize the code. */ - (void)dasm_checkstep(Dst, DASM_SECTION_CODE); + (void)dasm_checkstep(Dst, -1); if ((status = dasm_link(Dst, &ctx->codesz))) return status; ctx->code = (uint8_t *)malloc(ctx->codesz); if ((status = dasm_encode(Dst, (void *)ctx->code))) return status; @@ -431,9 +431,7 @@ int main(int argc, char **argv) } switch (ctx->mode) { -#if LJ_TARGET_X86ORX64 case BUILD_peobj: -#endif case BUILD_raw: binmode = 1; break; @@ -461,11 +459,9 @@ int main(int argc, char **argv) emit_asm(ctx); emit_asm_debug(ctx); break; -#if LJ_TARGET_X86ORX64 case BUILD_peobj: emit_peobj(ctx); break; -#endif case BUILD_raw: emit_raw(ctx); break;