fix(native): preserve mapping and literal coverage

This commit is contained in:
morluto committed 2026-10-27 10:26:29 +08:00
1 parent ded6542d93
commit b0c48e8b65
5 files changed
+161 -23

No files matched your search

+11 -4
View File
@@ -191,9 +191,18 @@ export const swiftLiteralSitesConflict = (
return false;
};
/** Omitted literal inventory differs from an observed empty inventory. */
export const swiftLiteralCoverage = (
snapshot: FunctionSnapshot,
): "absent" | "complete" | "partial" =>
(snapshot.dossier.swift_string_literal_omissions ?? []).length > 0
? "partial"
: snapshot.dossier.swift_string_literals === undefined
? "absent"
: "complete";
const swiftLiteralSites = (snapshot: FunctionSnapshot) => {
const base = snapshot.dossier.procedure.address;
const omissions = snapshot.dossier.swift_string_literal_omissions ?? [];
const site = (sourceAddress: string, registers: readonly string[]) => {
const offset = relativeAddress(sourceAddress, base);
return offset === null ? null : canonicalJson([offset, registers]);
@@ -211,9 +220,7 @@ const swiftLiteralSites = (snapshot: FunctionSnapshot) => {
].sort(compareUnicodeCodePoints),
);
}
const complete =
snapshot.dossier.swift_string_literals !== undefined &&
omissions.length === 0;
const complete = swiftLiteralCoverage(snapshot) === "complete";
return { values, complete };
};