forked from ground/ground
Stuff
This commit is contained in:
@@ -150,7 +150,20 @@ GroundValue groundRunFunction(GroundFunction* function, size_t argc, ...) {
|
||||
va_list args;
|
||||
va_start(args, argc);
|
||||
|
||||
GroundScope callScope = copyGroundScope(&function->closure);
|
||||
if (function == NULL) {
|
||||
return createErrorGroundValue(createGroundError("Null function passed to groundRunFunction", "valueError", NULL, NULL));
|
||||
}
|
||||
|
||||
// Seems to crash some functions
|
||||
// GroundScope callScope = copyGroundScope(&function->closure);
|
||||
|
||||
GroundScope callScope = {
|
||||
.labels = malloc(sizeof(GroundLabel*)),
|
||||
.variables = malloc(sizeof(GroundVariable*)),
|
||||
.isMainScope = false
|
||||
};
|
||||
*callScope.variables = NULL;
|
||||
*callScope.labels = NULL;
|
||||
|
||||
if (argc != function->argSize) {
|
||||
return createErrorGroundValue(createGroundError("Too few or too many arguments for function", "callError", NULL, NULL));
|
||||
|
||||
Reference in New Issue
Block a user