Skip to content

Commit 4bc222c

Browse files
committed
Address a few more review comments
1 parent 92c933e commit 4bc222c

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

src/drivers/libraries/Irql.qll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
*/
1414

1515
import cpp
16-
import semmle.code.cpp.controlflow.Dominance
1716
import drivers.libraries.SAL
1817
import drivers.wdm.libraries.WdmDrivers
1918
import drivers.libraries.IrqlDataFlow

src/drivers/libraries/Page.qll

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,16 @@ class PagedFunctionDeclaration extends Function {
113113
* level (rather than as joined `where`-clause predicates) lets the optimizer
114114
* materialize a small relation and avoid the full
115115
* `MacroInvocation x MacroInvocation` Cartesian product on large corpora.
116+
*
117+
* Routed through `getStmt()` (which always binds for `PAGED_CODE` /
118+
* `PAGED_CODE_LOCKED`, since they expand to a stmt-form
119+
* `NT_ASSERT_ASSUME`) to avoid the expensive `getAnAffectedElement`
120+
* join used by the stock `MacroInvocation.getEnclosingFunction()`.
116121
*/
117122
class PagedCodeMacro extends MacroInvocation {
118123
PagedCodeMacro() {
119124
this.getMacroName() = ["PAGED_CODE", "PAGED_CODE_LOCKED"]
125+
and this.getStmt().getEnclosingFunction() instanceof PagedFunctionDeclaration
120126
}
121127

122128
/**
@@ -125,11 +131,6 @@ class PagedCodeMacro extends MacroInvocation {
125131
* Gets the paged enclosing function for this macro invocation,
126132
* including template instantiations.
127133
*
128-
* Routed through `getStmt()` (which always binds for `PAGED_CODE` /
129-
* `PAGED_CODE_LOCKED`, since they expand to a stmt-form
130-
* `NT_ASSERT_ASSUME`) to avoid the expensive `getAnAffectedElement`
131-
* join used by the stock `MacroInvocation.getEnclosingFunction()`.
132-
*
133134
* NB: to compare two `PagedCodeMacro` invocations for "same
134135
* source-level function", also require `getFile()` agreement —
135136
* the extractor sometimes consolidates ODR-equivalent template
@@ -138,7 +139,6 @@ class PagedCodeMacro extends MacroInvocation {
138139
* function in another.
139140
*/
140141
Function getEnclosingPagedFunction() {
141-
result = this.getStmt().getEnclosingFunction() and
142-
result instanceof PagedFunctionDeclaration
142+
result = this.getStmt().getEnclosingFunction()
143143
}
144144
}

0 commit comments

Comments
 (0)