JS: Implement getBasicBlock() for exceptional nodes

This commit is contained in:
Asger F
2019-07-18 10:01:21 +01:00
parent 44a270a43d
commit e9c03c9820
3 changed files with 16 additions and 0 deletions

View File

@@ -788,6 +788,10 @@ module DataFlow {
function.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
}
override BasicBlock getBasicBlock() {
result = function.(ExprOrStmt).getBasicBlock()
}
/**
* Gets the function corresponding to this exceptional return node.
*/
@@ -810,6 +814,10 @@ module DataFlow {
invoke.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
}
override BasicBlock getBasicBlock() {
result = invoke.getBasicBlock()
}
/**
* Gets the invocation corresponding to this exceptional return node.
*/

View File

@@ -0,0 +1,3 @@
| tst.js:1:10:1:11 | fs |
| tst.js:1:10:1:11 | fs |
| tst.js:1:20:1:23 | 'fs' |

View File

@@ -0,0 +1,5 @@
import javascript
from DataFlow::Node node
where not exists(node.getBasicBlock())
select node