bug fixes

This commit is contained in:
cozis
2021-11-02 09:35:51 +00:00
parent 022610bb71
commit 51f782362e
2 changed files with 12 additions and 1 deletions
+9 -1
View File
@@ -46,8 +46,16 @@ Object *Object_FromNojaFunction(Runtime *runtime, Executable *exe, int index, He
if(func == NULL)
return NULL;
Executable *exe_copy = Executable_Copy(exe);
if(exe_copy == NULL)
{
Error_Report(error, 1, "Failed to copy executable");
return NULL;
}
func->runtime = runtime;
func->exe = exe;
func->exe = exe_copy;
func->index = index;
return (Object*) func;
}