Skip to content

Commit 23f111e

Browse files
committed
Working on castExprs
1 parent 1d949f5 commit 23f111e

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

codegen/metac_codegen.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -915,8 +915,13 @@ static void MetaCCodegen_doCastExpr(metac_bytecode_ctx_t* ctx,
915915
BCValue rhs = { BCValueType_Unknown };
916916
MetaCCodegen_doExpr(ctx, castExpr, &rhs, _Rvalue);
917917

918+
metac_type_index_kind_t castToKind = TYPE_INDEX_KIND(castToType);
919+
metac_type_index_kind_t castFromKind = TYPE_INDEX_KIND(castFromType);
920+
918921
assert(exp->Kind == expr_cast);
919922

923+
if (TYPE_INDEX_KIND(castToType) == TYPE_INDEX_KIND(castFromType) && )
924+
920925
if (castToType.v == TYPE_INDEX_V(type_index_basic, type_float))
921926
{
922927
if (castFromType.v == TYPE_INDEX_V(type_index_basic, type_int))
@@ -1417,7 +1422,7 @@ static void MetaCCodegen_doExpr(metac_bytecode_ctx_t* ctx,
14171422
}
14181423
sz = imm32(currentOffset);
14191424

1420-
BCValue address = gen.GenTemporary(c, BCType_i32);
1425+
BCValue address = gen.GenTemporary(c, BCType_u64);
14211426
gen.Alloc(c, &address, &sz);
14221427
gen.Set(c, result, &address);
14231428
for(uint32_t i = 0; i < exp->TupleExprCount; i++)

0 commit comments

Comments
 (0)