mirror of
https://github.com/github/codeql.git
synced 2026-04-27 17:55:19 +02:00
CPP: Fix issue.
This commit is contained in:
@@ -78,7 +78,20 @@ predicate emptyBlockContainsNonchild(Block b) {
|
||||
)
|
||||
}
|
||||
|
||||
predicate lineComment(Block b) {
|
||||
exists(File f, int line |
|
||||
f = b.getFile() and
|
||||
line = b.getLocation().getStartLine() and
|
||||
line = b.getLocation().getEndLine() and
|
||||
exists(Comment c |
|
||||
c.getFile() = f and
|
||||
c.getLocation().getStartLine() = line
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
from ControlStructure s, Block eb
|
||||
where emptyBlock(s, eb)
|
||||
and not emptyBlockContainsNonchild(eb)
|
||||
and not lineComment(eb)
|
||||
select eb, "Empty block without comment"
|
||||
|
||||
Reference in New Issue
Block a user