Commit 18dc385
committed
Clone a chain index before the getter consumes it.
`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.1 parent 7a32157 commit 18dc385
2 files changed
Lines changed: 21 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1440 | 1440 | | |
1441 | 1441 | | |
1442 | 1442 | | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
1443 | 1450 | | |
1444 | 1451 | | |
1445 | 1452 | | |
| |||
1497 | 1504 | | |
1498 | 1505 | | |
1499 | 1506 | | |
1500 | | - | |
| 1507 | + | |
1501 | 1508 | | |
1502 | 1509 | | |
1503 | 1510 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
100 | 108 | | |
101 | 109 | | |
102 | 110 | | |
| |||
227 | 235 | | |
228 | 236 | | |
229 | 237 | | |
| 238 | + | |
230 | 239 | | |
231 | 240 | | |
232 | 241 | | |
| |||
726 | 735 | | |
727 | 736 | | |
728 | 737 | | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
729 | 742 | | |
730 | 743 | | |
731 | 744 | | |
| |||
0 commit comments