Python: Add attributeClearStep

This commit is contained in:
Rasmus Wriedt Larsen
2022-02-02 09:57:13 +01:00
parent d2b72a7547
commit 51bc6dcf7e
2 changed files with 17 additions and 5 deletions

View File

@@ -1973,6 +1973,18 @@ predicate clearsContent(Node n, Content c) {
kwOverflowClearStep(n, c)
or
matchClearStep(n, c)
or
attributeClearStep(n, c)
}
/**
* Holds if values stored inside attribute `c` are cleared at node `n`.
*
* In `obj.foo = x` the any old value stored in `foo` is cleared at the pre-update node
* associated with `obj`
*/
predicate attributeClearStep(Node n, AttributeContent c) {
exists(PostUpdateNode post | post.getPreUpdateNode() = n | attributeStoreStep(_, c, post))
}
//--------