mirror of
https://github.com/janet-lang/janet
synced 2024-12-23 15:00:27 +00:00
Fix issue #189
This commit is contained in:
parent
474aed8cfe
commit
8e31bda8f6
@ -458,6 +458,10 @@ int main(int argc, const char **argv) {
|
||||
fprintf(stderr, "invalid bytecode image - expected function.");
|
||||
return 1;
|
||||
}
|
||||
JanetFunction *jfunc = janet_unwrap_function(marsh_out);
|
||||
|
||||
/* Check arity */
|
||||
janet_arity(argc, jfunc->def->min_arity, jfunc->def->max_arity);
|
||||
|
||||
/* Collect command line arguments */
|
||||
JanetArray *args = janet_array(argc);
|
||||
@ -475,7 +479,7 @@ int main(int argc, const char **argv) {
|
||||
janet_gcunlock(handle);
|
||||
|
||||
/* Run everything */
|
||||
JanetFiber *fiber = janet_fiber(janet_unwrap_function(marsh_out), 64, argc, argc ? args->data : NULL);
|
||||
JanetFiber *fiber = janet_fiber(jfunc, 64, argc, argc ? args->data : NULL);
|
||||
fiber->env = temptab;
|
||||
Janet out;
|
||||
JanetSignal result = janet_continue(fiber, janet_wrap_nil(), &out);
|
||||
|
Loading…
Reference in New Issue
Block a user