Skip to content

add missing source_location for assignments generated for initializers #6880

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
May 25, 2022

Conversation

kroening
Copy link
Member

A variable definition in C may include an initializer. We split these into
a DECL instruction and an ASSIGN instruction. This commit ensures that the
ASSIGN instruction has a source_location attached to it (clean_expr may
yield a temporary, which does not appear in the source code).

  • 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.
  • 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).
  • 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.

@kroening kroening marked this pull request as ready for review May 24, 2022 17:31
Copy link
Collaborator

@tautschnig tautschnig left a comment

Choose a reason for hiding this comment

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

The failing tests appear to demonstrate the (desired) effect, but will still need fixing.

@tautschnig tautschnig assigned kroening and unassigned tautschnig May 24, 2022
@kroening kroening force-pushed the fix_decl_assignment_loc branch from 252af48 to 5e2c337 Compare May 25, 2022 10:00
@codecov
Copy link

codecov bot commented May 25, 2022

Codecov Report

Merging #6880 (5e2c337) into develop (79169e0) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 5e2c337 differs from pull request most recent head bcca9da. Consider uploading reports for the commit bcca9da to get more accurate results

@@           Coverage Diff            @@
##           develop    #6880   +/-   ##
========================================
  Coverage    77.80%   77.80%           
========================================
  Files         1567     1567           
  Lines       179915   179916    +1     
========================================
+ Hits        139987   139988    +1     
  Misses       39928    39928           
Impacted Files Coverage Δ
src/goto-programs/goto_convert.cpp 92.34% <100.00%> (+<0.01%) ⬆️

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 679ab3f...bcca9da. Read the comment docs.

@tautschnig
Copy link
Collaborator

It seems that location15 also needs updating.

A variable definition in C may include an initializer.  We split these into
a DECL instruction and an ASSIGN instruction.  This commit ensures that the
ASSIGN instruction has a source_location attached to it (clean_expr may
yield a temporary, which does not appear in the source code).
@kroening kroening force-pushed the fix_decl_assignment_loc branch from 5e2c337 to bcca9da Compare May 25, 2022 12:30
@kroening kroening merged commit c688efd into develop May 25, 2022
@kroening kroening deleted the fix_decl_assignment_loc branch May 25, 2022 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants