| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1742,6 +1742,8 @@ module Make< | |||
| 1742 | 1742 | /** Gets the underlying expression. */ | |
| 1743 | 1743 | DfInput::Expr getExpr() { result = e } | |
| 1744 | 1744 | ||
| 1745 | + predicate isExprAndVariable(DfInput::Expr expr, SourceVariable var) { expr = e and var = v_ } | ||
| 1746 | + | ||
| 1745 | 1747 | override Location getLocation() { | |
| 1746 | 1748 | exists(BasicBlock bb, int i | | |
| 1747 | 1749 | e.hasCfgNode(bb, i) and | |
@@ -1769,7 +1771,7 @@ module Make< | |||
| 1769 | 1771 | ExprPostUpdateNodeImpl() { isPost = true } | |
| 1770 | 1772 | ||
| 1771 | 1773 | /** Gets the pre-update expression node. */ | |
| 1772 | - ExprNode getPreUpdateNode() { result = TExprNode(e, _, false) } | ||
| 1774 | + ExprNode getPreUpdateNode() { result = TExprNode(e, v_, false) } | ||
| 1773 | 1775 | ||
| 1774 | 1776 | override string toString() { result = e.toString() + " [postupdate]" } | |
| 1775 | 1777 | } | |
@@ -2026,13 +2028,13 @@ module Make< | |||
| 2026 | 2028 | v = def.getSourceVariable() and | |
| 2027 | 2029 | if DfInput::includeWriteDefsInFlowStep() | |
| 2028 | 2030 | then nodeTo.(SsaDefinitionNode).getDefinition() = def | |
| 2029 | - else nodeTo.(ExprNode).getExpr() = DfInput::getARead(def) | ||
| 2031 | + else nodeTo.(ExprNode).isExprAndVariable(DfInput::getARead(def), v) | ||
| 2030 | 2032 | ) | |
| 2031 | 2033 | or | |
| 2032 | 2034 | // Flow from SSA definition to read | |
| 2033 | 2035 | exists(DefinitionExt def | | |
| 2034 | 2036 | nodeFrom.(SsaDefinitionExtNodeImpl).getDefExt() = def and | |
| 2035 | - nodeTo.(ExprNode).getExpr() = DfInput::getARead(def) and | ||
| 2037 | + nodeTo.(ExprNode).isExprAndVariable(DfInput::getARead(def), v) and | ||
| 2036 | 2038 | v = def.getSourceVariable() | |
| 2037 | 2039 | ) | |
| 2038 | 2040 | } | |
@@ -2138,7 +2140,7 @@ module Make< | |||
| 2138 | 2140 | e = DfInput::getARead(def) and | |
| 2139 | 2141 | e.hasCfgNode(bb, _) and | |
| 2140 | 2142 | DfInput::guardControlsBlock(g, bb, val) and | |
| 2141 | - result.(ExprNode).getExpr() = e | ||
| 2143 | + result.(ExprNode).isExprAndVariable(e, def.getSourceVariable()) | ||
| 2142 | 2144 | ) | |
| 2143 | 2145 | or | |
| 2144 | 2146 | // guard controls input block to a phi node | |
| Back | FazBrowse Home | New Git URL |
0 commit comments