bug fixes
This commit is contained in:
@@ -46,8 +46,16 @@ Object *Object_FromNojaFunction(Runtime *runtime, Executable *exe, int index, He
|
|||||||
if(func == NULL)
|
if(func == NULL)
|
||||||
return 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->runtime = runtime;
|
||||||
func->exe = exe;
|
func->exe = exe_copy;
|
||||||
func->index = index;
|
func->index = index;
|
||||||
return (Object*) func;
|
return (Object*) func;
|
||||||
}
|
}
|
||||||
@@ -155,6 +155,9 @@ Source *Source_FromString(const char *name, const char *body, int size, Error *e
|
|||||||
|
|
||||||
if(name)
|
if(name)
|
||||||
strcpy(s->name, name);
|
strcpy(s->name, name);
|
||||||
|
else
|
||||||
|
s->name = NULL;
|
||||||
|
|
||||||
strncpy(s->body, body, size);
|
strncpy(s->body, body, size);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user