Repository navigation
fix(core)!: correct pod string iterator contracts - #168
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.