cool stuff
This commit is contained in:
@@ -3,12 +3,14 @@
|
||||
|
||||
void _GroundFunctionAppendArg(GroundFunction* function, const char* argName) {
|
||||
if (function->isNativeFunction) {
|
||||
Ground.Log.Error("Cannot add arg to native function in Ground.Function.appendArg()");
|
||||
Ground.Flags.error = true;
|
||||
return;
|
||||
}
|
||||
if (function->args.count + 1 >= function->args.capacity) {
|
||||
GroundFunctionArg* tmp = realloc(function->args.at, sizeof(GroundFunctionArg) * function->args.capacity * 2);
|
||||
if (tmp == NULL) {
|
||||
Ground.Log.Error("malloc failed in Ground.Function.appendArg()");
|
||||
Ground.Flags.error = true;
|
||||
return;
|
||||
}
|
||||
@@ -20,6 +22,7 @@ void _GroundFunctionAppendArg(GroundFunction* function, const char* argName) {
|
||||
size_t len = strlen(argName);
|
||||
function->args.at[function->args.count].as.id = malloc(sizeof(char) * (len + 1));
|
||||
if (function->args.at[function->args.count].as.id == NULL) {
|
||||
Ground.Log.Error("malloc failed in Ground.Function.appendArg()");
|
||||
Ground.Flags.error = true;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
void _GroundFunctionAppendInstruction(GroundFunction* function, GroundInstruction instruction) {
|
||||
if (function->isNativeFunction) {
|
||||
Ground.Log.Error("Cannot add instruction to native function in Ground.Function.appendInstruction()");
|
||||
Ground.Flags.error = true;
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user