Skip to content

fix(core)!: correct pod string iterator contracts - #168

Merged
nick2781 merged 1 commit into
mainfrom
fix/pod-string-iterator
Oct 26, 2026
Merged

nick2781 merged 1 commit into
mainfrom
fix/pod-string-iterator

Conversation

@nick2781

@nick2781 nick2781 commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Postfix increment returned a reference to a local iterator, while get_data() returned a mapped value where its declared type requires a pointer. Return the prior iterator by value and expose the stored value's address. Preserve prefix iteration, hashing, allocation, fields and the existing custom iterator interface.

Extend the existing Core runtime/header checks for prior-position lifetime, scalar and pointer-slot access, empty/end preconditions and array_map consumption. English/Chinese code-style guidance explains borrowing and migration. No tracked caller requires migration; external consumers need the upgrade described below.

Local acceptance at 37ef3ac passed: Core 67 cases/69,923 assertions, AddressSanitizer and UndefinedBehaviorSanitizer five selected cases/66 assertions (leak detection disabled), header checks, clang-format 18 and serial Nimbus with 139 pages/291 references plus actual bilingual article/Markdown checks. The added compile checks failed against the original implementation before the fix. Hosted platforms remain subject to this PR's own source and protected full-candidate checks.

BREAKING CHANGE: pod_string_iterator postfix increment returns an iterator value instead of a reference. Update non-const reference bindings or explicit signatures and rebuild affected consumers/plugins; emitted instantiation calling conventions may change despite unchanged fields.

Return the previous iterator by value and expose the address of its stored mapped value. Preserve prefix iteration and named lookup, with scalar/pointer coverage in the existing Core tests.

BREAKING CHANGE: pod_string_iterator postfix increment returns an iterator value instead of a reference. Update reference bindings or explicit signatures and rebuild affected consumers and plugins; emitted instantiation calling conventions may change.
@nick2781
nick2781 marked this pull request as ready for review October 26, 2026 11:10
@nick2781
nick2781 added this pull request to the merge queue Oct 26, 2026
Merged via the queue into main with commit 57eb61d Oct 26, 2026
12 checks passed
@nick2781
nick2781 deleted the fix/pod-string-iterator branch October 26, 2026 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant