@@ -477,13 +477,6 @@ void MetaCCodegen_Init(metac_bytecode_ctx_t* self, metac_alloc_t* parentAlloc)
477477 // ARENA_ARRAY_INIT(sema_decl_variable_t, self->Locals, &self->Allocator);
478478 ARENA_ARRAY_INIT (BCValue , self -> Globals , & self -> Allocator );
479479 self -> GlobalMemoryOffset = 4 ;
480-
481- #if METAC_COMPILER_INTERFACE
482- metac_external_entry_t * extCompP = self -> Externals + 0 ;
483- extCompP -> externalAddress = & compiler ;
484- extCompP -> externalSize = sizeof (compiler );
485- self -> ExternalsCount = 1 ;
486- #endif
487480}
488481
489482void MetaCCodegen_Free (metac_bytecode_ctx_t * self )
@@ -533,7 +526,7 @@ static void InitCompilerInterface(metac_bytecode_ctx_t* ctx)
533526 ctx -> Sema -> CompilerInterface -> TypeIndex .Index ;
534527
535528 ctx -> CompilerInterfaceValue = gen .GenExternal (c , compilerInterfaceType , ".compiler" );
536- gen .MapExternal (c , & ctx -> CompilerInterfaceValue , & compiler , sizeof (compiler ));
529+ // gen.MapExternal(c, &ctx->CompilerInterfaceValue, &compiler, sizeof(compiler));
537530 ctx -> Externals [0 ].ExtValue = ctx -> CompilerInterfaceValue ;
538531 ctx -> ExternalsCount += 1 ;
539532 }
@@ -695,7 +688,7 @@ metac_bytecode_function_t MetaCCodegen_GenerateFunction(metac_bytecode_ctx_t* ct
695688 ctx -> Sema -> CompilerInterface -> TypeIndex .Index ;
696689
697690 ctx -> CompilerInterfaceValue = gen .GenExternal (c , compilerInterfaceType , ".compiler" );
698- gen .MapExternal (c , & ctx -> CompilerInterfaceValue , & compiler , sizeof (compiler ));
691+ // gen.MapExternal(c, &ctx->CompilerInterfaceValue, &compiler, sizeof(compiler));
699692 ctx -> Externals [0 ].ExtValue = ctx -> CompilerInterfaceValue ;
700693 frameSize += sizeof (void * );
701694 }
@@ -920,7 +913,10 @@ static void MetaCCodegen_doCastExpr(metac_bytecode_ctx_t* ctx,
920913
921914 assert (exp -> Kind == expr_cast );
922915
923- if (TYPE_INDEX_KIND (castToType ) == TYPE_INDEX_KIND (castFromType ) && )
916+ if (castToKind == castFromKind && castToKind == type_index_ptr )
917+ {
918+
919+ }
924920
925921 if (castToType .v == TYPE_INDEX_V (type_index_basic , type_float ))
926922 {
@@ -1422,7 +1418,7 @@ static void MetaCCodegen_doExpr(metac_bytecode_ctx_t* ctx,
14221418 }
14231419 sz = imm32 (currentOffset );
14241420
1425- BCValue address = gen .GenTemporary (c , BCType_u64 );
1421+ BCValue address = gen .GenTemporary (c , BCType_u32 );
14261422 gen .Alloc (c , & address , & sz );
14271423 gen .Set (c , result , & address );
14281424 for (uint32_t i = 0 ; i < exp -> TupleExprCount ; i ++ )
0 commit comments