Merge pull request #3763 from adityasharad/java/training-example-brace

Fix training example syntax
This commit is contained in:
Shati Patel
2020-06-23 08:34:09 +01:00
committed by GitHub
2 changed files with 4 additions and 4 deletions

View File

@@ -2,11 +2,11 @@ import cpp
import semmle.code.cpp.dataflow.DataFlow
import semmle.code.cpp.commons.Printf
class SourceNode extends DataFlow::Node { ... }
class SourceNode extends DataFlow::Node { /* ... */ }
from FormattingFunction f, Call c, SourceNode src, DataFlow::Node arg
where c.getTarget() = f and
arg.asExpr() = c.getArgument(f.getFormatParameterIndex()) and
DataFlow::localFlow(src, arg) and
not src.asExpr() instanceof StringLiteral
select arg, "Non-constant format string."
select arg, "Non-constant format string."

View File

@@ -3,10 +3,10 @@ import java
class EmptyBlock extends Block {
EmptyBlock() {
this.getNumStmt() = 0
}
}
from IfStmt ifstmt
where ifstmt.getThen() instanceof
EmptyBlock
select ifstmt
select ifstmt