Skip to content

[TG-9313] Fix invariant failure in case of negative size arrays #5128

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

Merged

Conversation

romainbrenguier
Copy link
Contributor

This makes JBMC resilient to arrays declared with negative size.
Note that this wouldn't be a problem with --throw-runtime-exceptions as the declaration would be followed by a throw.

  • Each commit message has a non-empty body, explaining why the change was made.
  • [na] Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • [na] My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • White-space or formatting changes outside the feature-related changed lines are in commits of their own.

This used to make an invariant fail when the input array had negative
size.
If the specified array size is negative just do as if it was 0, this is
similar to the case where the array size is not given.
This tests that defining an array with negative size does not make JBMC crash.
@codecov-io
Copy link

codecov-io commented Sep 25, 2019

Codecov Report

Merging #5128 into develop will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #5128   +/-   ##
========================================
  Coverage    66.97%   66.97%           
========================================
  Files         1146     1146           
  Lines        93736    93736           
========================================
  Hits         62778    62778           
  Misses       30958    30958
Flag Coverage Δ
#cproversmt2 42.66% <85.71%> (-0.01%) ⬇️
#regression 63.46% <100%> (ø) ⬆️
#unit 31.9% <0%> (-0.01%) ⬇️
Impacted Files Coverage Δ
src/goto-symex/field_sensitivity.cpp 90.99% <100%> (-0.16%) ⬇️
src/solvers/flattening/boolbv_width.cpp 76.53% <100%> (+0.48%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2af983d...4259db2. Read the comment docs.

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

✔️
Passed Diffblue compatibility checks (cbmc commit: 4259db2).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/129092419

@romainbrenguier romainbrenguier merged commit ed29364 into diffblue:develop Sep 26, 2019
@romainbrenguier romainbrenguier deleted the bugfix/negative-size-arrays branch September 26, 2019 08:44
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 this pull request may close these issues.

5 participants