Commit a431bc8
committed
fix(time-zone): a failed TryFind handed back the caller's previous zone (#2177, SR-AUD-224)
TryFindSystemTimeZoneById caught the lookup failure and returned false without
touching `result`, so a caller reusing one variable across several lookups was
handed the zone from an earlier, unrelated call. Measured before the fix:
TryFind("Mars/Olympus", out) returned false with out still holding "UTC".
Real .NET assigns null to the out parameter; the catch-all now resets it.
+6 regressions in TimeZoneInfoTests.cpp covering a populated out parameter, an
empty id, a path-traversal id, two consecutive failures, and both directions of
the success path. Mutation proven: deleting the reset fails exactly the four
pins that depend on it and leaves the two controls green.
Suite 114 -> 120, all passing. One inline header body; no public signature,
virtual, vtable, object layout or mangled symbol changed.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014joExjgZv4aWFpzADeQGZm1 parent 886c066 commit a431bc8
3 files changed
Lines changed: 66 additions & 0 deletions
File tree
- modules/time-zone
- include/System
- tests/System
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
564 | 564 | | |
565 | 565 | | |
566 | 566 | | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
567 | 575 | | |
568 | 576 | | |
569 | 577 | | |
570 | 578 | | |
571 | 579 | | |
572 | 580 | | |
573 | 581 | | |
| 582 | + | |
574 | 583 | | |
575 | 584 | | |
576 | 585 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
606 | 606 | | |
607 | 607 | | |
608 | 608 | | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
Binary file not shown.
0 commit comments