Serialization: protect maybeReadGenericParams against errors

Update signature and implementation of `maybeReadGenericParams` to pass
up errors to the caller. Also update all of its callers to pass up any
error.

rdar://126582124
This commit is contained in:
Alexis Laferrière
2025-02-04 16:09:50 -08:00
parent a619daf12b
commit 6c23def371
2 changed files with 33 additions and 14 deletions

View File

@@ -507,7 +507,7 @@ private:
///
/// If the record at the cursor is not a generic param list, returns null
/// without moving the cursor.
GenericParamList *maybeReadGenericParams(DeclContext *DC);
llvm::Expected<GenericParamList *> maybeReadGenericParams(DeclContext *DC);
/// Reads a set of requirements from \c DeclTypeCursor.
void deserializeGenericRequirements(ArrayRef<uint64_t> scratch,