This commit is contained in:
2026-07-05 08:07:50 +10:00
parent 7cc1eed787
commit 3b8bcdf020
2 changed files with 8 additions and 3 deletions

View File

@@ -782,6 +782,7 @@ struct GroundExecutionResult _GroundBytecodeInstructionExecute(GroundBytecodeIns
for (GroundSize i = 0; i < function->args.count; i++) {
if (function->args.at[i].as.type.type != HEAP_GET(heap, instruction->args.at[i+1])->type.type) {
printf("%d != %d\n", function->args.at[i].as.type.type, HEAP_GET(heap, instruction->args.at[i+1])->type.type);
Ground.Log.Error("incorrect type of argument for native function in Ground.Bytecode.Instruction.execute");
Ground.Flags.error = true;
return CONTINUE;
@@ -979,15 +980,15 @@ struct GroundExecutionResult _GroundBytecodeInstructionExecute(GroundBytecodeIns
}
for (size_t i = 0; i < argsSize; i++) {
enum GroundTypeType argTypeType = HEAP_GET(heap, instruction->args.at[i + 4])->as.CoreType;
switch (argTypeType) {
GroundBytecodeValue* argTypeVal = HEAP_GET(heap, instruction->args.at[i + 4]);
switch (argTypeVal->type.type) {
case GroundType_Struct: {
bf.args.at[i].as.type.type = GroundType_Object;
// TODO implement structs
break;
}
case GroundType_CoreType: {
bf.args.at[i].as.type.type = HEAP_GET(heap, instruction->args.at[i + 4])->as.CoreType;
bf.args.at[i].as.type.type = argTypeVal->as.CoreType;
break;
}
default: {

View File

@@ -96,6 +96,10 @@ GroundBytecodeValue _GroundNewBytecodeValue(GroundValue value) {
// TODO - convert to bytecode object
break;
}
case GroundType_CoreType: {
bv.as.CoreType = value.as.CoreType;
break;
}
}
return bv;