bugfix! Missing error check in argument parsing routine

This commit is contained in:
cozis
2022-08-15 16:38:16 +02:00
parent cb5e41b814
commit 4a326bff7e
2 changed files with 12 additions and 1 deletions
+9
View File
@@ -0,0 +1,9 @@
fun add(a: int | float = 1, b = 8)
return a + b;
c = add(3, 4);
assert(c == 7);
print(c);
+2
View File
@@ -2023,6 +2023,8 @@ static Node *parse_function_definition(Context *ctx)
int argc = 0; // Initialization for the warning. int argc = 0; // Initialization for the warning.
Node *argv = parse_function_arguments(ctx, &argc); Node *argv = parse_function_arguments(ctx, &argc);
if(argv == NULL)
return NULL;
if(done(ctx)) if(done(ctx))
{ {