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

[critical] intsets.missingOrExcl silently gives wrong result in some cases #13505

Closed
timotheecour opened this issue Feb 26, 2020 · 0 comments · Fixed by #13498
Closed

[critical] intsets.missingOrExcl silently gives wrong result in some cases #13505

timotheecour opened this issue Feb 26, 2020 · 0 comments · Fixed by #13498

Comments

@timotheecour
Copy link
Member

intsets.missingOrExcl silently gives wrong result in some cases

Example

  import intsets
  var t: IntSet

  # these work
  t.incl 10
  doAssert not t.missingOrExcl(10)
  doAssert t.missingOrExcl(10)
  doAssert t.missingOrExcl(11)

  # let n = 30 # this would work
  let n = 40 # this will cause bug

  for i in 0..<n:
    t.incl(i)

  for i in 0..<n:
    doAssert i in t
    let isMissing = t.missingOrExcl(i)
    doAssert not isMissing, $i

Current Output

t10261.nim(86, 5) `not isMissing` 0 [AssertionError]

Expected Output

works

Additional Information

  • bug in 3dad130 1.1.1
  • bug in 1.0.6
timotheecour added a commit to timotheecour/Nim that referenced this issue Feb 26, 2020
Araq pushed a commit that referenced this issue Feb 26, 2020
… of tests (#13498) [backport]

* fix #13496 handle tombstones
* add test
* more tests
* fix #13504; add SharedTable tests
* fix ##13505 intsets.missingOrExcl silently gave wrong results sometimes
* add test for tintsets
narimiran pushed a commit that referenced this issue Apr 14, 2020
… of tests (#13498) [backport]

* fix #13496 handle tombstones
* add test
* more tests
* fix #13504; add SharedTable tests
* fix ##13505 intsets.missingOrExcl silently gave wrong results sometimes
* add test for tintsets

(cherry picked from commit 42dad3a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant