mirror of
https://github.com/github/codeql.git
synced 2026-05-02 20:25:13 +02:00
fix PrintAST test run
The refactored shouldDumpFunction was now rejecting functions without a location. This is fixed now.
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
private import cpp
|
||||
|
||||
/**
|
||||
* Holds if an AST or IR with the specified location should be printed in the test output.
|
||||
*
|
||||
* This predicate excludes locations in standard headers.
|
||||
* Holds if the specified location is in standard headers.
|
||||
*/
|
||||
predicate shouldDumpLocation(Location loc) {
|
||||
not loc.getFile().getAbsolutePath().regexpMatch(".*/include/[^/]+")
|
||||
predicate locationIsInStandardHeaders(Location loc) {
|
||||
loc.getFile().getAbsolutePath().regexpMatch(".*/include/[^/]+")
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -14,4 +12,4 @@ predicate shouldDumpLocation(Location loc) {
|
||||
*
|
||||
* This predicate excludes functions defined in standard headers.
|
||||
*/
|
||||
predicate shouldDumpFunction(Function func) { shouldDumpLocation(func.getLocation()) }
|
||||
predicate shouldDumpFunction(Function func) { not locationIsInStandardHeaders(func.getLocation()) }
|
||||
|
||||
@@ -3,5 +3,5 @@ private import semmle.code.cpp.ir.IR
|
||||
private import PrintConfig
|
||||
|
||||
from Operand a
|
||||
where shouldDumpLocation(a.getLocation())
|
||||
where not locationIsInStandardHeaders(a.getLocation())
|
||||
select a, a.getDumpString()
|
||||
|
||||
Reference in New Issue
Block a user