Skip to content

Fix compiler assert about bounds expression already existing.#537

Merged
dtarditi merged 1 commit into
masterfrom
issue526
Aug 1, 2018
Merged

Fix compiler assert about bounds expression already existing.#537
dtarditi merged 1 commit into
masterfrom
issue526

Conversation

@dtarditi

Copy link
Copy Markdown
Member

The children() method for iterating over chidren of AST cast expressions
was incorrectly including compiler-generated bounds expressions. Child AST
nodes should be nodes that appear in the source program and additional
information shouldn't be treated as child nodes. There were
complex IR invariants about when a bounds expression stored within a cast
expression was child AST node or not.

This change fixes the bug and simplifies the AST invariants. This fixes
issue #526. for cast expressions, there is now one entry for bounds expressions
declared as part of the program. There are separate nodes for normalized
bounds and inferred bounds.

Testing:

  • Added a new regression test case for the failing case.
  • Passes existing Checked C and clang Checked C tests.

The children() method for iterating over chidren of AST cast expressions
was incorrectly including compiler-generated bounds expressions.  Child AST
nodes should be nodes that appear in the source program and additional
information shouldn't be treated as child nodes.   There were
complex IR invariants about when a bounds expression stored within a cast
expression was child AST node or not.

This change fixes the bug and simplifies the AST invariants. This fixes
issue #526. for cast expressions, there is now one entry for bounds expressions
declared as part of the program. There are separate nodes for normalized
bounds and inferred bounds.

Testing:
- Added a new regression test case for the failing case.
- Passes existing Checked C and clang Checked C tests.
@dtarditi dtarditi requested a review from Prabhuk July 30, 2018 22:55

@Prabhuk Prabhuk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The changes look good. Thank you.

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.

2 participants