Clone a chain index before the getter consumes it - #1140
Merged
Conversation
`index_by_reference` cloned the index for the write-back setter after calling `get_indexed_mut`, which binds a native's by-value parameter by `take` — so the setter was called with `()`, found nothing, and `call_indexer_set` swallowed the error. The write was dropped silently. Rhai clones before the same call (`eval/chaining.rs:706`). Only the paths that can write pay for it.
schungx
approved these changes
Aug 20, 2026
schungx
requested changes
Aug 20, 2026
schungx
left a comment
Collaborator
There was a problem hiding this comment.
Fix another big in one go.
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.
index_by_referencecloned the index for the write-back setter after callingget_indexed_mut, which binds a native's by-value parameter bytake. The setter was called with(), found nothing, andcall_indexer_setswallowed the error. The write was dropped silently. Rhai clones before the same call (eval/chaining.rs:706). Only the paths that can write pay for it.