Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(gnovm): fix max names in block check (#2645)
I noticed this while reviewing #2429. The previous conditional could never evaluate to true: `if (1<<16 - 1) < sb.NumNames {`. `sb.NumNames` is a `uint16` and the value it is being compared to, `1<<16 - 1` is the max uint16 value, so it is impossible the the number of names to be greater than this value. Instead, we should check to see if the current number of names is the maximum value and panic if this is the case. <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