Commit d07bebe
committed
fix(cha): skip CHA expansion for super-dispatch edges in runChaPostPass and runPostNativeCha
When a method calls super.method(), the resolver creates an edge from the
subclass method to the parent class method (e.g. PostMixin.m → A.m).
runChaPostPass and runPostNativeCha then incorrectly CHA-expanded this edge
to all sibling subclasses of A (e.g. B from other files that also extend A),
producing false PostMixin.m → B.m edges across unrelated files.
Fix: before BFS-expanding a caller→type.method edge, check whether the
caller's class is itself a direct child of the target type. If so, the edge
was produced by a super.method() call (going up the hierarchy) and must not
be expanded downward to sibling subclasses. This applies to both runChaPostPass
(WASM path) and runPostNativeCha (native orchestrator path), which share the
same CHA expansion loop structure.
Verified by node scripts/parity-compare.mjs --langs jelly-micro: the 6
PostMixin super4 false edges are eliminated; all 3048 tests pass.1 parent ce510f3 commit d07bebe
2 files changed
Lines changed: 52 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
464 | 464 | | |
465 | 465 | | |
466 | 466 | | |
467 | | - | |
| 467 | + | |
468 | 468 | | |
469 | 469 | | |
| 470 | + | |
470 | 471 | | |
471 | 472 | | |
472 | 473 | | |
473 | | - | |
| 474 | + | |
474 | 475 | | |
475 | 476 | | |
476 | 477 | | |
| |||
497 | 498 | | |
498 | 499 | | |
499 | 500 | | |
500 | | - | |
| 501 | + | |
501 | 502 | | |
502 | 503 | | |
503 | 504 | | |
504 | 505 | | |
505 | 506 | | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
506 | 520 | | |
507 | 521 | | |
508 | 522 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
572 | 572 | | |
573 | 573 | | |
574 | 574 | | |
575 | | - | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
576 | 581 | | |
577 | 582 | | |
578 | | - | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
579 | 589 | | |
580 | 590 | | |
581 | 591 | | |
582 | 592 | | |
583 | 593 | | |
584 | | - | |
| 594 | + | |
585 | 595 | | |
586 | 596 | | |
587 | 597 | | |
| |||
591 | 601 | | |
592 | 602 | | |
593 | 603 | | |
| 604 | + | |
594 | 605 | | |
595 | 606 | | |
596 | 607 | | |
| |||
600 | 611 | | |
601 | 612 | | |
602 | 613 | | |
603 | | - | |
| 614 | + | |
604 | 615 | | |
605 | 616 | | |
606 | 617 | | |
607 | 618 | | |
608 | 619 | | |
609 | 620 | | |
610 | | - | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
611 | 627 | | |
612 | 628 | | |
613 | 629 | | |
| |||
635 | 651 | | |
636 | 652 | | |
637 | 653 | | |
638 | | - | |
| 654 | + | |
639 | 655 | | |
640 | 656 | | |
641 | 657 | | |
642 | 658 | | |
643 | 659 | | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
644 | 673 | | |
645 | 674 | | |
646 | 675 | | |
| |||
0 commit comments