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

Bug fixes and modest extensions #44

Closed
secure-sw-dev-bot opened this issue Jan 16, 2022 · 3 comments
Closed

Bug fixes and modest extensions #44

secure-sw-dev-bot opened this issue Jan 16, 2022 · 3 comments

Comments

@secure-sw-dev-bot
Copy link

This issue was copied from checkedc/checkedc-clang#44


Many changes to deal with running on "real" code:

  • In certain situations (macros) two AST nodes can occupy precisely the same source location. This is a problem for the re-writer that maintains a strong mapping between source locations and constraint variables, especially for whole-program analysis. The rewriter now does something conservative where two constraint variables that occupy the same source location implicitly alias.
  • In other situations, it's difficult to know what to do when re-writing structure typedefs or other kinds of typedefs. We now do something conservative where structure typedefs are left alone.
  • There is now a bunch of defensive programming to keep the rewriting logic from trying to do rash things like rewrite a declaration that starts in one file and ends in another file.
@secure-sw-dev-bot
Copy link
Author

Comment from @dtarditi:

Generally looks good - I've pointed out some minor nits in the code.

The PersistentSourceLoc file needs more comments describing what it is doing. Please clarify that the source location used for comparisons is the original textual location, not the expanded source location.

You might want a helper function for validating that a range can be rewritten. Currently, you are checking that a range is valid and that getRangeSize(...) != -1. The test that getRangeSize(...) != -1 is idiomatic, so using a helper function would make the code clearer to read.

@secure-sw-dev-bot
Copy link
Author

Comment from @awruef:

I think I've addressed the code review feedback.

@secure-sw-dev-bot
Copy link
Author

Comment from @dtarditi:

LGTM.

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

No branches or pull requests

1 participant