Files
reverse-engineering-anything/src/domain/managed/managedMemberInstructionFacts.ts
T
morluto 749ae11b15 fix(managed): share reference instruction semantics
Use the same parsed method/field operand predicate when producing member edges and comparing call and field shapes. Exclude ldtoken and operands without a value from both interpretations.
2026-10-23 19:07:46 +08:00

19 lines
702 B
TypeScript

/** Facts available on decoded member-reference-bearing CIL instructions. */
export interface ManagedMemberInstructionFact {
readonly opcode: string;
readonly operand_kind: string;
readonly operand: string | null;
}
/** Whether an instruction contributes a method or field operand fact to member analysis. */
export const isManagedMemberReferenceInstruction = (
instruction: ManagedMemberInstructionFact,
): instruction is ManagedMemberInstructionFact & {
readonly operand_kind: "method" | "field";
readonly operand: string;
} =>
instruction.opcode !== "ldtoken" &&
instruction.operand !== null &&
(instruction.operand_kind === "method" ||
instruction.operand_kind === "field");