Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
106f260d18 | ||
|
|
7b2087e449 |
No files matched your search
@@ -38,7 +38,12 @@ export const classifySwiftSymbol = (
|
|||||||
let category: SwiftTypeCategory | null = null;
|
let category: SwiftTypeCategory | null = null;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
const end = identifierEnd(mangling, offset);
|
const end = identifierEnd(mangling, offset);
|
||||||
if (end === undefined) break;
|
if (end === undefined) {
|
||||||
|
// A word-substituted or punycode identifier (`0…`) may name a nested
|
||||||
|
// type of any kind, so the enclosing nominal no longer decides it.
|
||||||
|
if (mangling.charAt(offset) === "0") category = null;
|
||||||
|
break;
|
||||||
|
}
|
||||||
const kind = mangling.charAt(end);
|
const kind = mangling.charAt(end);
|
||||||
const nominal = NOMINAL_CATEGORIES.get(kind);
|
const nominal = NOMINAL_CATEGORIES.get(kind);
|
||||||
if (nominal === undefined) {
|
if (nominal === undefined) {
|
||||||
|
|||||||
@@ -28,6 +28,10 @@ describe("modern Swift category evidence", () => {
|
|||||||
"$sSi4mainE7doubledSiyF",
|
"$sSi4mainE7doubledSiyF",
|
||||||
"$s9999999999999999999999BadVMa",
|
"$s9999999999999999999999BadVMa",
|
||||||
"$s4main04PairVMa",
|
"$s4main04PairVMa",
|
||||||
|
// Nested types named by punycode identifiers inside struct Envelope.
|
||||||
|
"_$s6Nested8EnvelopeV007IhuqBAbO8describeSSyF",
|
||||||
|
"_$s6Nested8EnvelopeV007jvrtDBlCAEycfC",
|
||||||
|
"_$s6Nested8EnvelopeV007jvrtDBlCMa",
|
||||||
];
|
];
|
||||||
const result = categorizeSwiftTypes(
|
const result = categorizeSwiftTypes(
|
||||||
names.map((name, index) => ({ address: String(index), name })),
|
names.map((name, index) => ({ address: String(index), name })),
|
||||||
@@ -52,6 +56,16 @@ describe("modern Swift category evidence", () => {
|
|||||||
).toMatchObject({ total: 0, unclassified: [] });
|
).toMatchObject({ total: 0, unclassified: [] });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("keeps a nested punycode class unresolved under a class filter", () => {
|
||||||
|
const name = "_$s6Nested8EnvelopeV007jvrtDBlCMa";
|
||||||
|
expect(
|
||||||
|
categorizeSwiftTypes([{ address: "0x1", name }], { category: "classes" }),
|
||||||
|
).toMatchObject({
|
||||||
|
total: 0,
|
||||||
|
unclassified: [{ name, reason: "category_not_decoded" }],
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it("deduplicates display names after selecting a category", () => {
|
it("deduplicates display names after selecting a category", () => {
|
||||||
expect(
|
expect(
|
||||||
categorizeSwiftTypes(
|
categorizeSwiftTypes(
|
||||||
|
|||||||
@@ -176,7 +176,13 @@ it.each(["caller", "host"] as const)(
|
|||||||
);
|
);
|
||||||
let closing: ReturnType<NonNullable<typeof host.close>> | undefined;
|
let closing: ReturnType<NonNullable<typeof host.close>> | undefined;
|
||||||
try {
|
try {
|
||||||
await expect.poll(async () => (await fakeKunaCalls(kuna)).length).toBe(1);
|
// The preceding Ghidra probe may prepare Darwin process ownership before
|
||||||
|
// Kuna starts; keep startup separate from the bounded post-abort join.
|
||||||
|
await expect
|
||||||
|
.poll(async () => (await fakeKunaCalls(kuna)).length, {
|
||||||
|
timeout: 10_000,
|
||||||
|
})
|
||||||
|
.toBe(1);
|
||||||
const probe = (await fakeKunaCalls(kuna))[0];
|
const probe = (await fakeKunaCalls(kuna))[0];
|
||||||
if (probe === undefined) throw new Error("Missing Kuna version probe");
|
if (probe === undefined) throw new Error("Missing Kuna version probe");
|
||||||
expect(probe.argv).toEqual(["--version"]);
|
expect(probe.argv).toEqual(["--version"]);
|
||||||
|
|||||||
Reference in new issue
Block a user