aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVeikka Tuominen <git@vexu.eu>2022-12-08 19:28:01 +0200
committerAndrew Kelley <andrew@ziglang.org>2022-12-09 20:37:18 -0700
commit5831b68341827b544ea3f268c921e9044bd11047 (patch)
tree552359dd5f312f582e45ba84d2e656c85cd7e697 /src
parentb483c796c66e3a415a7590bfe62f316fa8fa70e6 (diff)
downloadzig-5831b68341827b544ea3f268c921e9044bd11047.tar.gz
zig-5831b68341827b544ea3f268c921e9044bd11047.zip
AstGen: add check for missing builtin argument
Closes #13817
Diffstat (limited to 'src')
-rw-r--r--src/AstGen.zig4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/AstGen.zig b/src/AstGen.zig
index c9f44a6216..021990883a 100644
--- a/src/AstGen.zig
+++ b/src/AstGen.zig
@@ -9098,6 +9098,8 @@ fn nodeMayNeedMemoryLocation(tree: *const Ast, start_node: Ast.Node.Index, have_
.always => return true,
.forward1 => node = node_datas[node].rhs,
}
+ // Missing builtin arg is not a parsing error, expect an error later.
+ if (node == 0) return false;
},
.builtin_call, .builtin_call_comma => {
@@ -9112,6 +9114,8 @@ fn nodeMayNeedMemoryLocation(tree: *const Ast, start_node: Ast.Node.Index, have_
.always => return true,
.forward1 => node = params[1],
}
+ // Missing builtin arg is not a parsing error, expect an error later.
+ if (node == 0) return false;
},
}
}