Commit 893af0f
committed
fix: eliminate super-dispatch self-loops in CHA post-pass
runChaPostPass (helpers.ts, WASM path) was emitting self-loop edges like
B.m → B.m when expanding class A's implementors: it found B.m via
findMethodStmt but had no guard against the case where methodNode.id equals
the source_id (the calling method itself). Add the missing guard.
runPostNativeThisDispatch (native-orchestrator.ts) similarly lacked a self-loop
guard in its targets loop — add it to keep the native path consistent.
Also aligns runPostNativeCha to use file-pair-aware confidence (computeConfidence
- CHA_DISPATCH_PENALTY) instead of a hardcoded 0.8, matching the WASM path.
Gate B now checks the same kind set as Gate A for future-proofing.
Remaining jelly-micro divergences filed as separate issues:
- #1510: receiver-callee-mixup attribution (findCaller tie-break for same-line defs)
- #1511: dynamic pts cross-file edges (fun.js, classes2.js apply/call)
- #1512: native missing f.h→f.g this-dispatch for func-prop methods
- #1513: prototypes.js receiver edge non-determinism
docs check acknowledged: no language, feature, or architecture changes.
Closes #14721 parent 37bb91a commit 893af0f
2 files changed
Lines changed: 16 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
511 | 511 | | |
512 | 512 | | |
513 | 513 | | |
| 514 | + | |
514 | 515 | | |
515 | 516 | | |
516 | 517 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
523 | 523 | | |
524 | 524 | | |
525 | 525 | | |
526 | | - | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
527 | 530 | | |
528 | 531 | | |
529 | 532 | | |
| |||
534 | 537 | | |
535 | 538 | | |
536 | 539 | | |
537 | | - | |
| 540 | + | |
| 541 | + | |
538 | 542 | | |
539 | 543 | | |
540 | 544 | | |
| |||
556 | 560 | | |
557 | 561 | | |
558 | 562 | | |
559 | | - | |
560 | | - | |
| 563 | + | |
| 564 | + | |
561 | 565 | | |
562 | 566 | | |
563 | 567 | | |
| |||
653 | 657 | | |
654 | 658 | | |
655 | 659 | | |
656 | | - | |
657 | | - | |
658 | | - | |
659 | | - | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
660 | 666 | | |
661 | 667 | | |
662 | 668 | | |
| |||
900 | 906 | | |
901 | 907 | | |
902 | 908 | | |
| 909 | + | |
903 | 910 | | |
904 | 911 | | |
905 | 912 | | |
| |||
0 commit comments