Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: boolean operations must have boolean operands #1451

Merged
merged 3 commits into from
Dec 18, 2023

Conversation

deelawn
Copy link
Contributor

@deelawn deelawn commented Dec 17, 2023

Addresses #1083

This fixes an issue where there was no enforcement of operand types when doing boolean operations. The correct approach should be to verify boolean operand type expressions also evaluate to boolean typed values before proceeding. This prevents any of the behavior described in the issue that this PR addresses.

Contributors' checklist...
  • Added new tests, or not needed, or not feasible
  • Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory
  • Updated the official documentation or not needed
  • No breaking changes were made, or a BREAKING CHANGE: xxx message was included in the description
  • Added references to related issues and PRs
  • Provided any useful hints for running manual tests
  • Added new benchmarks to generated graphs, if any. More info here.

@github-actions github-actions bot added the 📦 🤖 gnovm Issues or PRs gnovm related label Dec 17, 2023
Copy link

codecov bot commented Dec 17, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (6cabad4) 56.05% compared to head (a3e0af3) 56.05%.

Files Patch % Lines
gnovm/pkg/gnolang/preprocess.go 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1451      +/-   ##
==========================================
- Coverage   56.05%   56.05%   -0.01%     
==========================================
  Files         421      421              
  Lines       65457    65459       +2     
==========================================
  Hits        36692    36692              
- Misses      25897    25898       +1     
- Partials     2868     2869       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@deelawn deelawn marked this pull request as draft December 17, 2023 09:27
@deelawn deelawn marked this pull request as ready for review December 17, 2023 17:26
@deelawn deelawn requested a review from a team as a code owner December 17, 2023 17:26
Copy link
Contributor

@jaekwon jaekwon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TY!
These sorts of additions of checks are always welcome.

@jaekwon jaekwon merged commit 64b7d88 into gnolang:master Dec 18, 2023
185 of 186 checks passed
@thehowl
Copy link
Member

thehowl commented Dec 18, 2023

also related to #1424

gfanton pushed a commit to moul/gno that referenced this pull request Jan 18, 2024
<!-- please provide a detailed description of the changes made in this
pull request. -->
Addresses gnolang#1083

This fixes an issue where there was no enforcement of operand types when
doing boolean operations. The correct approach should be to verify
boolean operand type expressions also evaluate to boolean typed values
before proceeding. This prevents any of the behavior described in the
issue that this PR addresses.

<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
- [ ] Provided any useful hints for running manual tests
- [ ] 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 🤖 gnovm Issues or PRs gnovm related
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

boolean operators (||, &&) allowed in return values (for non-boolean return values)
3 participants