fix(native): require observed symbol origin for named identity

This commit is contained in:
morluto
2026-10-24 04:07:29 +08:00
parent 98ddd04433
commit 62f7b5e4cd
23 changed files with 395 additions and 107 deletions
@@ -1,10 +1,8 @@
import type { Evidence } from "../evidence.js";
import type { FunctionDossier } from "../hopperValues.js";
import { digestCanonicalValue } from "../canonicalDigest.js";
import {
hasStableFunctionName,
normalizeCfg,
} from "../functionComparisonNormalization.js";
import { normalizeCfg } from "../functionComparisonNormalization.js";
import { hasStableNativeSymbol } from "./nativeSymbol.js";
import { assessFunctionCallCoverage } from "../functionCallCoverage.js";
import { compareUnicodeCodePoints } from "../unicodeCodePointOrder.js";
@@ -29,7 +27,9 @@ export const functionStructuralCandidate = (
if (
cfg === null ||
cfg.length === 0 ||
dossier.callees.some((callee) => !hasStableFunctionName(callee.name))
dossier.callees.some(
(callee) => !hasStableNativeSymbol(callee.name, callee.symbol),
)
)
return null;
const calls = dossier.callees