Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(gnovm): Resolve RefValues before using as Objects (#2454)
Closes #2449. I believe the bug was introduced by #2255. Previously, if the type of `tv.V` in `GetFirstObject` was a `PointerValue`, it the `Base` would have been nil in the scenario producing this bug. Now that `Base` can never be nil for a `PointerValue`, the nil base check has been removed. We do however need to account for a new scenario where the `Base` is a `RefValue`, a type that does implement the `Object` interface. In the case where the base is a `RefValue`, first resolve it by calling `store.GetObject`. <!-- please provide a detailed description of the changes made in this pull request. --> <details><summary>Contributors' checklist...</summary> - [x] Added new tests, or not needed, or not feasible - [x] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [x] Updated the official documentation or not needed - [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [x] Added references to related issues and PRs - [x] Provided any useful hints for running manual tests - [x] Added new benchmarks to [generated graphs](https://gnoland.github.io/benchmarks), if any. More info [here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md). </details>
- Loading branch information