Skip to content

Do not use invalid_source_file_exceptiont without source location #5835

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
merged 1 commit into from
Feb 24, 2022

Conversation

tautschnig
Copy link
Collaborator

In preparation of tying invalid_source_file_exceptiont to an actual
source location, introduce an exception that is thrown when some invalid
input is encountered, but a precise source location is not known at the
time of throwing the exception.

  • Each commit message has a non-empty body, explaining why the change was made.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a 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).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@codecov
Copy link

codecov bot commented Feb 18, 2021

Codecov Report

Merging #5835 (d63c7f0) into develop (afc53d8) will increase coverage by 0.00%.
The diff coverage is 53.65%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #5835   +/-   ##
========================================
  Coverage    76.73%   76.73%           
========================================
  Files         1579     1579           
  Lines       181999   181995    -4     
========================================
- Hits        139652   139650    -2     
+ Misses       42347    42345    -2     
Impacted Files Coverage Δ
jbmc/src/java_bytecode/lazy_goto_model.cpp 82.17% <0.00%> (ø)
src/crangler/ctokenit.cpp 0.00% <0.00%> (ø)
src/crangler/mini_c_parser.cpp 72.67% <0.00%> (ø)
src/goto-programs/slice_global_inits.h 0.00% <0.00%> (ø)
src/goto-programs/string_instrumentation.h 0.00% <0.00%> (ø)
src/memory-analyzer/analyze_symbol.cpp 72.98% <0.00%> (ø)
src/symtab2gb/symtab2gb_parse_options.cpp 63.38% <0.00%> (ø)
unit/testing-utils/get_goto_model_from_c.cpp 89.47% <0.00%> (+2.29%) ⬆️
jbmc/src/java_bytecode/java_bytecode_language.cpp 92.80% <50.00%> (+0.13%) ⬆️
src/util/exception_utils.cpp 91.66% <84.61%> (-2.68%) ⬇️
... and 9 more

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 c351198...d63c7f0. Read the comment docs.

Copy link
Collaborator

@martin-cs martin-cs left a comment

Choose a reason for hiding this comment

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

Seems reasonable.

Copy link
Contributor

@chrisr-diffblue chrisr-diffblue left a comment

Choose a reason for hiding this comment

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

Thanks - thats a nice cleanup improvement. As an aside, I can't help thinking an additional intermediate class in the exception hierarchy - something like a cprover_exception_with_descriptiont to cover what appears to be the very common pattern of "exception is constructed from a std::string argument, and what() just returns that string" might make exception_utils.{h,cpp} somewhat more succinct... one for another day though!

@tautschnig
Copy link
Collaborator Author

Thanks - thats a nice cleanup improvement. As an aside, I can't help thinking an additional intermediate class in the exception hierarchy - something like a cprover_exception_with_descriptiont to cover what appears to be the very common pattern of "exception is constructed from a std::string argument, and what() just returns that string" might make exception_utils.{h,cpp} somewhat more succinct... one for another day though!

Good call! I'm about to add a commit to #5837 to sort this out. I did, however, opt to make cprover_exception_baset that very class: all inheriting classes want that description.

@tautschnig tautschnig removed their assignment Jan 23, 2022
@tautschnig
Copy link
Collaborator Author

Thanks - thats a nice cleanup improvement. As an aside, I can't help thinking an additional intermediate class in the exception hierarchy - something like a cprover_exception_with_descriptiont to cover what appears to be the very common pattern of "exception is constructed from a std::string argument, and what() just returns that string" might make exception_utils.{h,cpp} somewhat more succinct... one for another day though!

Good call! I'm about to add a commit to #5837 to sort this out. I did, however, opt to make cprover_exception_baset that very class: all inheriting classes want that description.

... and now also made this a PR of its own in #6608.

@tautschnig tautschnig force-pushed the invalid_input_exceptiont branch from ada2a90 to 55e69f8 Compare January 23, 2022 20:37
@chrisr-diffblue
Copy link
Contributor

Thanks - thats a nice cleanup improvement. As an aside, I can't help thinking an additional intermediate class in the exception hierarchy - something like a cprover_exception_with_descriptiont to cover what appears to be the very common pattern of "exception is constructed from a std::string argument, and what() just returns that string" might make exception_utils.{h,cpp} somewhat more succinct... one for another day though!

Good call! I'm about to add a commit to #5837 to sort this out. I did, however, opt to make cprover_exception_baset that very class: all inheriting classes want that description.

... and now also made this a PR of its own in #6608.

You're too good to us... :-)

@tautschnig tautschnig force-pushed the invalid_input_exceptiont branch from 55e69f8 to 5ed1623 Compare February 8, 2022 14:09
In preparation of tying invalid_source_file_exceptiont to an actual
source location, introduce an exception that is thrown when some invalid
input is encountered, but a precise source location is not known at the
time of throwing the exception.
@tautschnig tautschnig force-pushed the invalid_input_exceptiont branch from 5ed1623 to d63c7f0 Compare February 8, 2022 14:17
@tautschnig tautschnig merged commit 98c23f5 into diffblue:develop Feb 24, 2022
@tautschnig tautschnig deleted the invalid_input_exceptiont branch February 24, 2022 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants