Skip to content

Erase deleted nodes from LazyNodeData::givens_ on NodeDeleted - #5533

Draft
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_1027420332
Draft

copybara-service[bot] wants to merge 1 commit into
mainfrom
test_1027420332

Conversation

@copybara-service

Copy link
Copy Markdown

Erase deleted nodes from LazyNodeData::givens_ on NodeDeleted

LazyNodeData::NodeDeleted cleared cache_ via cache_.Forget(node) when a Node* was removed from the bound FunctionBase, but left any entry for node in givens_. When passes such as ProcStateEliminationPass or ArraySimplificationPass deleted a StateRead while CachedStateElementQueryEngine held state-element givens and the allocator later reused the freed Node* address for a newly created node, LazyNodeData::ComputeValue matched the stale givens_ entry—either crashing on mismatched leaf/bit widths in MergeWithGiven or silently intersecting unrelated node facts with the deleted node's given.

Erase node from givens_ in LazyNodeData::NodeDeleted and add regression tests in ManualGivenQueryEngineTest and CachedStateElementQueryEngineTest.

`LazyNodeData::NodeDeleted` cleared `cache_` via `cache_.Forget(node)` when a `Node*` was removed from the bound `FunctionBase`, but left any entry for `node` in `givens_`. When passes such as `ProcStateEliminationPass` or `ArraySimplificationPass` deleted a `StateRead` while `CachedStateElementQueryEngine` held state-element givens and the allocator later reused the freed `Node*` address for a newly created node, `LazyNodeData::ComputeValue` matched the stale `givens_` entry—either crashing on mismatched leaf/bit widths in `MergeWithGiven` or silently intersecting unrelated node facts with the deleted node's given.

Erase `node` from `givens_` in `LazyNodeData::NodeDeleted` and add regression tests in `ManualGivenQueryEngineTest` and `CachedStateElementQueryEngineTest`.

PiperOrigin-RevId: 1027420332

This branch has not been deployed

No deployments
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.

1 participant