@@ -125,7 +125,9 @@ module Stmts {
125
125
c instanceof SimpleCompletion
126
126
}
127
127
128
- predicate firstInner ( ControlFlowElement first ) { astFirst ( ast .getFirstElement ( ) , first ) }
128
+ predicate firstInner ( ControlFlowElement first ) {
129
+ astFirst ( ast .getFirstElement ( ) .getFullyUnresolved ( ) , first )
130
+ }
129
131
130
132
/** Gets the body of the i'th `defer` statement. */
131
133
private BraceStmt getDeferStmtBody ( int i ) {
@@ -181,32 +183,32 @@ module Stmts {
181
183
182
184
predicate lastInner ( ControlFlowElement last , Completion c ) {
183
185
// Normal exit and no defer statements
184
- astLast ( ast .getLastElement ( ) , last , c ) and
186
+ astLast ( ast .getLastElement ( ) . getFullyUnresolved ( ) , last , c ) and
185
187
not exists ( this .getFirstDeferStmtBody ( ) ) and
186
188
c instanceof NormalCompletion
187
189
or
188
190
// Normal exit from the last defer statement to be executed
189
- astLast ( this .getLastDeferStmtBody ( ) , last , c ) and
191
+ astLast ( this .getLastDeferStmtBody ( ) . getFullyUnresolved ( ) , last , c ) and
190
192
c instanceof NormalCompletion
191
193
or
192
194
// Abnormal exit without any defer statements
193
195
not c instanceof NormalCompletion and
194
- astLast ( ast .getAnElement ( ) , last , c ) and
196
+ astLast ( ast .getAnElement ( ) . getFullyUnresolved ( ) , last , c ) and
195
197
not exists ( this .getFirstDeferStmtBody ( ) )
196
198
}
197
199
198
200
override predicate succ ( ControlFlowElement pred , ControlFlowElement succ , Completion c ) {
199
201
// left-to-right evaluation of statements
200
202
exists ( int i |
201
- astLast ( ast .getElement ( i ) , pred , c ) and
202
- astFirst ( ast .getElement ( i + 1 ) , succ ) and
203
+ astLast ( ast .getElement ( i ) . getFullyUnresolved ( ) , pred , c ) and
204
+ astFirst ( ast .getElement ( i + 1 ) . getFullyUnresolved ( ) , succ ) and
203
205
c instanceof NormalCompletion
204
206
)
205
207
or
206
208
// Flow from last elements to the first defer statement to be executed
207
209
c instanceof NormalCompletion and
208
- astLast ( ast .getLastElement ( ) , pred , c ) and
209
- astFirst ( this .getFirstDeferStmtBody ( ) , succ )
210
+ astLast ( ast .getLastElement ( ) . getFullyUnresolved ( ) , pred , c ) and
211
+ astFirst ( this .getFirstDeferStmtBody ( ) . getFullyUnresolved ( ) , succ )
210
212
or
211
213
// Flow from a defer statement to the next defer to be executed
212
214
c instanceof NormalCompletion and
@@ -218,7 +220,7 @@ module Stmts {
218
220
// Abnormal exit from an element to the first defer statement to be executed.
219
221
not c instanceof NormalCompletion and
220
222
exists ( int i |
221
- astLast ( ast .getElement ( i ) , pred , c ) and
223
+ astLast ( ast .getElement ( i ) . getFullyUnresolved ( ) , pred , c ) and
222
224
astFirst ( this .getDeferStmtBodyAfterStmt ( i ) , succ )
223
225
)
224
226
}
0 commit comments