Pathfinder::moveAllies can continue walking a path after a nested move-away order destroys it.
Unit A orders B out of the way. B's own path walk orders A to move away, and A calls destroyPath() on the path the outer walk is still using. The outer walk then continues over freed nodes.
This can crash or change which allies get ordered to move, depending on what happens to the freed memory. Earlier testing with freed-memory poisoning exposed both outcomes.
[VS22 replay: 3323-moveallies-reentry.zip](https://github.com/user-attachments/files/32566939/3323-moveallies-reentry.zip)
Recorded with the automated LAN harness: Twilight Flame, two human GLA players and five hard AI.
To Reproduce:
- Play the replay on a stock VS22 Release build from
e4017100cd.
- At frame 27111, watch Demo Scorpion 15538 order Demo Quad Cannon 14444 out of the way.
- The Quad's walk orders the Scorpion to move away. The Scorpion's
privateMoveAwayFromUnit destroys the path its outer moveAllies call is still walking.
This replay reproduces the freed-path access, not a Release crash. The base build finishes all 36540 frames without a CRC mismatch.
Pathfinder::moveAlliescan continue walking a path after a nested move-away order destroys it.Unit A orders B out of the way. B's own path walk orders A to move away, and A calls
destroyPath()on the path the outer walk is still using. The outer walk then continues over freed nodes.This can crash or change which allies get ordered to move, depending on what happens to the freed memory. Earlier testing with freed-memory poisoning exposed both outcomes.
[VS22 replay: 3323-moveallies-reentry.zip](https://github.com/user-attachments/files/32566939/3323-moveallies-reentry.zip)
Recorded with the automated LAN harness: Twilight Flame, two human GLA players and five hard AI.
To Reproduce:
e4017100cd.privateMoveAwayFromUnitdestroys the path its outermoveAlliescall is still walking.This replay reproduces the freed-path access, not a Release crash. The base build finishes all 36540 frames without a CRC mismatch.