fix(apple): harden dyld cache reads, mappings, and resolution findings

This commit is contained in:
morluto
2026-10-08 15:36:31 +08:00
parent cd622e0e95
commit d081ffbdce
8 changed files with 138 additions and 20 deletions
+8 -2
View File
@@ -87,11 +87,17 @@ export const traceDylibResolution = async (options: {
readonly signal?: AbortSignal;
}): Promise<DylibResolutionResult> => {
const parsed = dylibResolutionInputSchema.safeParse(options.parameters);
if (!parsed.success)
if (!parsed.success) {
const issue = parsed.error.issues[0];
const at =
issue !== undefined && issue.path.length > 0
? ` (${issue.path.join(".")} ${issue.message})`
: "";
throw new ArtifactReaderFailure(
"path",
"roots must be normalized paths relative to the analyzed root",
`dylib resolution parameters are invalid${at}`,
);
}
let cache: DyldSharedCache | undefined;
// Canonicalization is inside the translated region: a revoked permission
// keeps its reason and path.