Fixes
This commit is contained in:
@@ -782,6 +782,7 @@ struct GroundExecutionResult _GroundBytecodeInstructionExecute(GroundBytecodeIns
|
|||||||
|
|
||||||
for (GroundSize i = 0; i < function->args.count; i++) {
|
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) {
|
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.Log.Error("incorrect type of argument for native function in Ground.Bytecode.Instruction.execute");
|
||||||
Ground.Flags.error = true;
|
Ground.Flags.error = true;
|
||||||
return CONTINUE;
|
return CONTINUE;
|
||||||
@@ -979,15 +980,15 @@ struct GroundExecutionResult _GroundBytecodeInstructionExecute(GroundBytecodeIns
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (size_t i = 0; i < argsSize; i++) {
|
for (size_t i = 0; i < argsSize; i++) {
|
||||||
enum GroundTypeType argTypeType = HEAP_GET(heap, instruction->args.at[i + 4])->as.CoreType;
|
GroundBytecodeValue* argTypeVal = HEAP_GET(heap, instruction->args.at[i + 4]);
|
||||||
switch (argTypeType) {
|
switch (argTypeVal->type.type) {
|
||||||
case GroundType_Struct: {
|
case GroundType_Struct: {
|
||||||
bf.args.at[i].as.type.type = GroundType_Object;
|
bf.args.at[i].as.type.type = GroundType_Object;
|
||||||
// TODO implement structs
|
// TODO implement structs
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GroundType_CoreType: {
|
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;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
|
|||||||
@@ -96,6 +96,10 @@ GroundBytecodeValue _GroundNewBytecodeValue(GroundValue value) {
|
|||||||
// TODO - convert to bytecode object
|
// TODO - convert to bytecode object
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case GroundType_CoreType: {
|
||||||
|
bv.as.CoreType = value.as.CoreType;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return bv;
|
return bv;
|
||||||
|
|||||||
Reference in New Issue
Block a user