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

CellBounds: Handle comparisons with builder.bits() and builder.refs() #209

Open
jubnzv opened this issue Nov 5, 2024 · 1 comment
Open
Labels
area:detectors Related to existing detectors enhancement New feature or request

Comments

@jubnzv
Copy link
Member

jubnzv commented Nov 5, 2024

If there are comparisons involving these method calls in the dataflow, we should not consider data and references added later in the dataflow as rule violations.

@jubnzv jubnzv added enhancement New feature or request area:detectors Related to existing detectors labels Nov 5, 2024
@jubnzv jubnzv changed the title CellOverflow: Handle comparisons with builder.bits() and builder.refs() CellOverflow/CellUnderflow: Handle comparisons with builder.bits() and builder.refs() Nov 12, 2024
@jubnzv
Copy link
Member Author

jubnzv commented Nov 12, 2024

Using this approach we could also generate warnings for Cell arguments of unknown size:

fun test(c: Cell /* unknown size */) {
  let s = c.asSlice();

  s.loadBool(); // Bad: Possible cell underflow

  if (s.bits() > 1) {
    s.loadBool(); // OK
  }
}

@jubnzv jubnzv changed the title CellOverflow/CellUnderflow: Handle comparisons with builder.bits() and builder.refs() CellBounds: Handle comparisons with builder.bits() and builder.refs() Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:detectors Related to existing detectors enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant