Skip to content

string_constantt::to_array_expr must maintain the source location #6995

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

tautschnig
Copy link
Collaborator

The C front-end uses this method to create arrays from string literals.
The resulting expression must have a source location to ensure the
resulting GOTO instruction knows which source location to use.

Fixes: #6994

  • Each commit message has a non-empty body, explaining why the change was made.
  • n/a 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 Jul 6, 2022

Codecov Report

Merging #6995 (917f9a0) into develop (09e1041) will increase coverage by 0.01%.
The diff coverage is 92.50%.

@@             Coverage Diff             @@
##           develop    #6995      +/-   ##
===========================================
+ Coverage    77.81%   77.83%   +0.01%     
===========================================
  Files         1570     1569       -1     
  Lines       180682   180624      -58     
===========================================
- Hits        140601   140583      -18     
+ Misses       40081    40041      -40     
Impacted Files Coverage Δ
src/util/string_constant.h 86.66% <ø> (ø)
...ncremental/smt2_incremental_decision_procedure.cpp 97.25% <ø> (ø)
src/linking/linking.cpp 59.36% <68.96%> (+0.65%) ⬆️
src/analyses/does_remove_const.cpp 100.00% <100.00%> (ø)
src/crangler/mini_c_parser.cpp 72.58% <100.00%> (+1.55%) ⬆️
src/goto-instrument/replace_calls.cpp 89.70% <100.00%> (-0.15%) ⬇️
src/goto-programs/goto_program.cpp 81.80% <100.00%> (ø)
src/goto-programs/remove_function_pointers.cpp 92.79% <100.00%> (ø)
...c/solvers/smt2_incremental/convert_expr_to_smt.cpp 88.29% <100.00%> (+0.57%) ⬆️
...ncremental/smt2_incremental_decision_procedure.cpp 94.73% <100.00%> (ø)
... and 13 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 21ff086...917f9a0. Read the comment docs.

@tautschnig tautschnig force-pushed the bugfixes/6994-to_array_expr-source-loc branch from dcb3fb4 to 5e89559 Compare July 6, 2022 10:23
The C front-end uses this method to create arrays from string literals.
The resulting expression must have a source location to ensure the
resulting GOTO instruction knows which source location to use.

Fixes: diffblue#6994
This helper will copy the source location from another expression, if it
has any. Implemented as a fluent interface, with a first specialisation
for array_exprt. Other expression types an use
with_source_location<X_exprt> or add specialisations.
@tautschnig tautschnig force-pushed the bugfixes/6994-to_array_expr-source-loc branch from 5e89559 to 917f9a0 Compare July 6, 2022 11:30
@tautschnig tautschnig self-assigned this Jul 6, 2022
@tautschnig tautschnig merged commit ea0e1b1 into diffblue:develop Jul 6, 2022
@tautschnig tautschnig deleted the bugfixes/6994-to_array_expr-source-loc branch July 6, 2022 13:03
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.

Source location missing from array initialization in error trace
3 participants