mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-19 09:00:27 +00:00
Don't crash if a builtin fn is declared with positional parameters. (#5444)
Crash discovered by fuzzer.
This commit is contained in:
1 parent
e060342411
commit
f2a16d8742
2 files changed
+83
No files matched your search
@@ -681,6 +681,11 @@ static auto IsValidBuiltinDeclaration(Context& context,
|
||||
const SemIR::Function& function,
|
||||
SemIR::BuiltinFunctionKind builtin_kind)
|
||||
-> bool {
|
||||
if (!function.call_params_id.has_value()) {
|
||||
// For now, we have no builtins that support positional parameters.
|
||||
return false;
|
||||
}
|
||||
|
||||
// Find the list of call parameters other than the implicit return slot.
|
||||
auto call_params = context.inst_blocks().Get(function.call_params_id);
|
||||
if (function.return_slot_pattern_id.has_value()) {
|
||||
|
||||
Reference in new issue
Block a user