mirror of
https://github.com/github/codeql.git
synced 2026-03-01 13:23:49 +01:00
Merge branch 'main' into mathiasvp/array-field-flow
This commit is contained in:
49
.github/workflows/query-list.yml
vendored
Normal file
49
.github/workflows/query-list.yml
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
name: Build code scanning query list
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- 'rc/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/query-list.yml'
|
||||
- 'misc/scripts/generate-code-scanning-query-list.py'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Clone self (github/codeql)
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: codeql
|
||||
- name: Clone github/codeql-go
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: 'github/codeql-go'
|
||||
path: codeql-go
|
||||
- name: Set up Python 3.8
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.8
|
||||
- name: Download CodeQL CLI
|
||||
uses: dsaltares/fetch-gh-release-asset@aa37ae5c44d3c9820bc12fe675e8670ecd93bd1c
|
||||
with:
|
||||
repo: "github/codeql-cli-binaries"
|
||||
version: "latest"
|
||||
file: "codeql-linux64.zip"
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Unzip CodeQL CLI
|
||||
run: unzip -d codeql-cli codeql-linux64.zip
|
||||
- name: Build code scanning query list
|
||||
run: |
|
||||
PATH="$PATH:codeql-cli/codeql" python codeql/misc/scripts/generate-code-scanning-query-list.py > code-scanning-query-list.csv
|
||||
- name: Upload code scanning query list
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: code-scanning-query-list
|
||||
path: code-scanning-query-list.csv
|
||||
|
||||
@@ -20,7 +20,10 @@ The following changes in version 1.26 affect C/C++ analysis in all applications.
|
||||
|
||||
## Changes to libraries
|
||||
|
||||
* The QL class `Block`, denoting the `{ ... }` statement, is renamed to `BlockStmt`.
|
||||
* The models library now models many taint flows through `std::array`, `std::vector`, `std::deque`, `std::list` and `std::forward_list`.
|
||||
* The models library now models many more taint flows through `std::string`.
|
||||
* The models library now models some taint flows through `std::ostream`.
|
||||
* The models library now models some taint flows through `std::shared_ptr`, `std::unique_ptr`, `std::make_shared` and `std::make_unique`.
|
||||
* The `SimpleRangeAnalysis` library now supports multiplications of the form
|
||||
`e1 * e2` and `x *= e2` when `e1` and `e2` are unsigned or constant.
|
||||
|
||||
21
change-notes/1.26/analysis-java.md
Normal file
21
change-notes/1.26/analysis-java.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# Improvements to Java analysis
|
||||
|
||||
The following changes in version 1.26 affect Java analysis in all applications.
|
||||
|
||||
## General improvements
|
||||
|
||||
## New queries
|
||||
|
||||
| **Query** | **Tags** | **Purpose** |
|
||||
|-----------------------------|-----------|--------------------------------------------------------------------|
|
||||
|
||||
|
||||
## Changes to existing queries
|
||||
|
||||
| **Query** | **Expected impact** | **Change** |
|
||||
|------------------------------|------------------------|-----------------------------------|
|
||||
|
||||
|
||||
## Changes to libraries
|
||||
|
||||
* The QL class `Block`, denoting the `{ ... }` statement, is renamed to `BlockStmt`.
|
||||
@@ -30,6 +30,7 @@
|
||||
| Incomplete URL substring sanitization (`js/incomplete-url-substring-sanitization`) | More results | This query now recognizes additional URLs when the substring check is an inclusion check. |
|
||||
| Ambiguous HTML id attribute (`js/duplicate-html-id`) | Results no longer shown | Precision tag reduced to "low". The query is no longer run by default. |
|
||||
| Unused loop iteration variable (`js/unused-loop-variable`) | Fewer results | This query no longer flags variables in a destructuring array assignment that are not the last variable in the destructed array. |
|
||||
| Unsafe shell command constructed from library input (`js/shell-command-constructed-from-input`) | More results | This query now recognizes more commands where colon, dash, and underscore are used. |
|
||||
| Unsafe jQuery plugin (`js/unsafe-jquery-plugin`) | More results | This query now detects more unsafe uses of nested option properties. |
|
||||
|
||||
|
||||
|
||||
@@ -9,6 +9,6 @@
|
||||
|
||||
import cpp
|
||||
|
||||
from Block blk
|
||||
from BlockStmt blk
|
||||
where blk.getNumStmt() = 0
|
||||
select blk
|
||||
|
||||
@@ -13,5 +13,5 @@
|
||||
import cpp
|
||||
|
||||
from IfStmt i
|
||||
where i.getThen().(Block).getNumStmt() = 0
|
||||
where i.getThen().(BlockStmt).getNumStmt() = 0
|
||||
select i
|
||||
|
||||
@@ -8,6 +8,6 @@
|
||||
|
||||
import cpp
|
||||
|
||||
from Block b
|
||||
from BlockStmt b
|
||||
where b.getNumStmt() = 1
|
||||
select b
|
||||
|
||||
@@ -14,7 +14,7 @@ import cpp
|
||||
|
||||
class ComplexStmt extends Stmt {
|
||||
ComplexStmt() {
|
||||
exists(Block body |
|
||||
exists(BlockStmt body |
|
||||
body = this.(Loop).getStmt() or
|
||||
body = this.(SwitchStmt).getStmt()
|
||||
|
|
||||
@@ -24,7 +24,7 @@ class ComplexStmt extends Stmt {
|
||||
}
|
||||
}
|
||||
|
||||
from Block b, int n, ComplexStmt complexStmt
|
||||
from BlockStmt b, int n, ComplexStmt complexStmt
|
||||
where
|
||||
n = strictcount(ComplexStmt s | s = b.getAStmt()) and
|
||||
n > 3 and
|
||||
|
||||
@@ -17,7 +17,7 @@ where
|
||||
shadowing(lv1, lv2) and
|
||||
not lv1.isCompilerGenerated() and
|
||||
not lv2.isCompilerGenerated() and
|
||||
not lv1.getParentScope().(Block).isInMacroExpansion() and
|
||||
not lv2.getParentScope().(Block).isInMacroExpansion()
|
||||
not lv1.getParentScope().(BlockStmt).isInMacroExpansion() and
|
||||
not lv2.getParentScope().(BlockStmt).isInMacroExpansion()
|
||||
select lv1, "Variable " + lv1.getName() + " hides another variable of the same name (on $@).", lv2,
|
||||
"line " + lv2.getLocation().getStartLine().toString()
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
import cpp
|
||||
|
||||
predicate emptyBlock(ControlStructure s, Block b) {
|
||||
predicate emptyBlock(ControlStructure s, BlockStmt b) {
|
||||
b = s.getAChild() and
|
||||
not exists(b.getAChild()) and
|
||||
not b.isInMacroExpansion() and
|
||||
@@ -23,7 +23,7 @@ predicate emptyBlock(ControlStructure s, Block b) {
|
||||
|
||||
class AffectedFile extends File {
|
||||
AffectedFile() {
|
||||
exists(Block b |
|
||||
exists(BlockStmt b |
|
||||
emptyBlock(_, b) and
|
||||
this = b.getFile()
|
||||
)
|
||||
@@ -37,7 +37,7 @@ class AffectedFile extends File {
|
||||
class BlockOrNonChild extends Element {
|
||||
BlockOrNonChild() {
|
||||
(
|
||||
this instanceof Block
|
||||
this instanceof BlockStmt
|
||||
or
|
||||
this instanceof Comment
|
||||
or
|
||||
@@ -78,7 +78,7 @@ class BlockOrNonChild extends Element {
|
||||
/**
|
||||
* A block that contains a non-child element.
|
||||
*/
|
||||
predicate emptyBlockContainsNonchild(Block b) {
|
||||
predicate emptyBlockContainsNonchild(BlockStmt b) {
|
||||
emptyBlock(_, b) and
|
||||
exists(BlockOrNonChild c, AffectedFile file |
|
||||
c.(BlockOrNonChild).getStartRankIn(file) = 1 + b.(BlockOrNonChild).getStartRankIn(file) and
|
||||
@@ -91,7 +91,7 @@ predicate emptyBlockContainsNonchild(Block b) {
|
||||
* A block that is entirely on one line, which also contains a comment. Chances
|
||||
* are the comment is intended to refer to the block.
|
||||
*/
|
||||
predicate lineComment(Block b) {
|
||||
predicate lineComment(BlockStmt b) {
|
||||
emptyBlock(_, b) and
|
||||
exists(Location bLocation, File f, int line |
|
||||
bLocation = b.getLocation() and
|
||||
@@ -106,7 +106,7 @@ predicate lineComment(Block b) {
|
||||
)
|
||||
}
|
||||
|
||||
from ControlStructure s, Block eb
|
||||
from ControlStructure s, BlockStmt eb
|
||||
where
|
||||
emptyBlock(s, eb) and
|
||||
not emptyBlockContainsNonchild(eb) and
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
import cpp
|
||||
import semmle.code.cpp.commons.Exclusions
|
||||
|
||||
Stmt getNextRealStmt(Block b, int i) {
|
||||
Stmt getNextRealStmt(BlockStmt b, int i) {
|
||||
result = b.getStmt(i + 1) and
|
||||
not result instanceof EmptyStmt
|
||||
or
|
||||
@@ -20,7 +20,7 @@ Stmt getNextRealStmt(Block b, int i) {
|
||||
result = getNextRealStmt(b, i + 1)
|
||||
}
|
||||
|
||||
from JumpStmt js, Block b, int i, Stmt s
|
||||
from JumpStmt js, BlockStmt b, int i, Stmt s
|
||||
where
|
||||
b.getStmt(i) = js and
|
||||
s = getNextRealStmt(b, i) and
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
import cpp
|
||||
|
||||
int lineInBlock(File f) {
|
||||
exists(Block block, Location blockLocation |
|
||||
exists(BlockStmt block, Location blockLocation |
|
||||
block.getFile() = f and blockLocation = block.getLocation()
|
||||
|
|
||||
result in [blockLocation.getStartLine() .. blockLocation.getEndLine()]
|
||||
|
||||
@@ -27,11 +27,11 @@ predicate macroUseLocation(File f, int start, int end) {
|
||||
}
|
||||
|
||||
pragma[noopt]
|
||||
predicate emptyIf(IfStmt s, Block b, File f, int start, int end) {
|
||||
predicate emptyIf(IfStmt s, BlockStmt b, File f, int start, int end) {
|
||||
s instanceof IfStmt and
|
||||
not exists(s.getElse()) and
|
||||
b = s.getThen() and
|
||||
b instanceof Block and
|
||||
b instanceof BlockStmt and
|
||||
not exists(b.getAChild()) and
|
||||
f = b.getFile() and
|
||||
exists(Location l |
|
||||
@@ -42,7 +42,7 @@ predicate emptyIf(IfStmt s, Block b, File f, int start, int end) {
|
||||
}
|
||||
|
||||
pragma[noopt]
|
||||
predicate query(IfStmt s, Block b) {
|
||||
predicate query(IfStmt s, BlockStmt b) {
|
||||
exists(File f, int blockStart, int blockEnd |
|
||||
emptyIf(s, b, f, blockStart, blockEnd) and
|
||||
not exists(int macroStart, int macroEnd |
|
||||
@@ -53,7 +53,7 @@ predicate query(IfStmt s, Block b) {
|
||||
)
|
||||
}
|
||||
|
||||
from IfStmt s, Block b
|
||||
from IfStmt s, BlockStmt b
|
||||
where
|
||||
query(s, b) and
|
||||
not b.isInMacroExpansion()
|
||||
|
||||
@@ -27,7 +27,7 @@ int logicalLength(FunctionDeclarationEntry f) {
|
||||
count(Stmt s |
|
||||
s.getEnclosingFunction() = f.getFunction() and
|
||||
s.getFile() = f.getFile() and
|
||||
not s instanceof Block and
|
||||
not s instanceof BlockStmt and
|
||||
not s instanceof EmptyStmt and
|
||||
not exists(ForStmt for | s = for.getInitialization()) and
|
||||
not s.isAffectedByMacro()
|
||||
|
||||
@@ -14,7 +14,7 @@ import cpp
|
||||
class OneLineStmt extends Stmt {
|
||||
OneLineStmt() {
|
||||
this.getLocation().getStartLine() = this.getLocation().getEndLine() and
|
||||
not this instanceof Block and
|
||||
not this instanceof BlockStmt and
|
||||
not exists(ForStmt for | this = for.getInitialization()) and
|
||||
(
|
||||
// Either this statement is not touched by a macro at all...
|
||||
|
||||
@@ -27,7 +27,7 @@ int logicalLength(FunctionDeclarationEntry f) {
|
||||
count(Stmt s |
|
||||
s.getEnclosingFunction() = f.getFunction() and
|
||||
s.getFile() = f.getFile() and
|
||||
not s instanceof Block and
|
||||
not s instanceof BlockStmt and
|
||||
not s instanceof EmptyStmt and
|
||||
not exists(ForStmt for | s = for.getInitialization()) and
|
||||
not s.isAffectedByMacro()
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
import cpp
|
||||
|
||||
predicate blockDominates(Block check, Block access) {
|
||||
predicate blockDominates(BlockStmt check, BlockStmt access) {
|
||||
check.getLocation().getStartLine() <= access.getLocation().getStartLine() and
|
||||
check.getLocation().getEndLine() >= access.getLocation().getEndLine()
|
||||
}
|
||||
|
||||
2
cpp/ql/src/external/CodeDuplication.qll
vendored
2
cpp/ql/src/external/CodeDuplication.qll
vendored
@@ -117,7 +117,7 @@ private predicate blockCoversStatement(int equivClass, int first, int last, Stmt
|
||||
private Stmt statementInMethod(FunctionDeclarationEntry m) {
|
||||
result.getParent+() = m.getBlock() and
|
||||
not result.getLocation() instanceof UnknownStmtLocation and
|
||||
not result instanceof Block
|
||||
not result instanceof BlockStmt
|
||||
}
|
||||
|
||||
private predicate duplicateStatement(
|
||||
|
||||
@@ -13,7 +13,7 @@ import cpp
|
||||
|
||||
from Stmt parent, Stmt child
|
||||
where
|
||||
not child instanceof Block and
|
||||
not child instanceof BlockStmt and
|
||||
(
|
||||
child = parent.(IfStmt).getThen()
|
||||
or
|
||||
|
||||
@@ -28,7 +28,7 @@ predicate oppositeOperators(string op1, string op2) {
|
||||
* `!op2(_, _)`.
|
||||
*/
|
||||
predicate implementedAsNegationOf(Operator op1, Operator op2) {
|
||||
exists(Block b, ReturnStmt r, NotExpr n, Expr o |
|
||||
exists(BlockStmt b, ReturnStmt r, NotExpr n, Expr o |
|
||||
b = op1.getBlock() and
|
||||
b.getNumStmt() = 1 and
|
||||
r = b.getStmt(0) and
|
||||
|
||||
@@ -29,7 +29,7 @@ predicate localShadowsParameter(LocalVariable lv, Parameter p) {
|
||||
|
||||
from Variable v, Variable shadowed
|
||||
where
|
||||
not v.getParentScope().(Block).isInMacroExpansion() and
|
||||
not v.getParentScope().(BlockStmt).isInMacroExpansion() and
|
||||
(
|
||||
v.(LocalVariableOrParameter).shadowsGlobal(shadowed.(GlobalVariable)) or
|
||||
localShadowsParameter(v, shadowed) or
|
||||
|
||||
@@ -38,7 +38,7 @@ predicate noDefUsePath(LocalVariable lv, ControlFlowNode n) {
|
||||
}
|
||||
|
||||
predicate neighbouringStmts(Stmt s1, Stmt s2) {
|
||||
exists(Block b, int i |
|
||||
exists(BlockStmt b, int i |
|
||||
i in [0 .. b.getNumStmt() - 2] and
|
||||
s1 = b.getStmt(i) and
|
||||
s2 = b.getStmt(i + 1)
|
||||
|
||||
@@ -22,6 +22,6 @@ where
|
||||
not s instanceof ControlStructure and
|
||||
// Exclude blocks; if a child of the block violates the rule that will still
|
||||
// be picked up so there is no point in blaming the block as well
|
||||
not s instanceof Block and
|
||||
not s instanceof BlockStmt and
|
||||
s.isPure()
|
||||
select s, "AV Rule 187: All non-null statements shall potentially have a side-effect."
|
||||
|
||||
@@ -18,7 +18,7 @@ import cpp
|
||||
|
||||
// whether t is the last statement of s, possibly peeling off blocks
|
||||
predicate isTerminatingStmt(Stmt s, Stmt t) {
|
||||
s = t or isTerminatingStmt(s.(Block).getLastStmt(), t)
|
||||
s = t or isTerminatingStmt(s.(BlockStmt).getLastStmt(), t)
|
||||
}
|
||||
|
||||
from BreakStmt s
|
||||
|
||||
@@ -128,7 +128,7 @@ class Element extends ElementBase {
|
||||
|
||||
/**
|
||||
* Gets the parent scope of this `Element`, if any.
|
||||
* A scope is a `Type` (`Class` / `Enum`), a `Namespace`, a `Block`, a `Function`,
|
||||
* A scope is a `Type` (`Class` / `Enum`), a `Namespace`, a `BlockStmt`, a `Function`,
|
||||
* or certain kinds of `Statement`.
|
||||
*/
|
||||
Element getParentScope() {
|
||||
@@ -161,7 +161,7 @@ class Element extends ElementBase {
|
||||
exists(EnumConstant e | this = e and result = e.getDeclaringEnum())
|
||||
or
|
||||
// result instanceof block|function
|
||||
exists(Block b | this = b and blockscope(unresolveElement(b), unresolveElement(result)))
|
||||
exists(BlockStmt b | this = b and blockscope(unresolveElement(b), unresolveElement(result)))
|
||||
or
|
||||
exists(TemplateFunction tf | this = tf.getATemplateArgument() and result = tf)
|
||||
or
|
||||
|
||||
@@ -268,7 +268,7 @@ class Function extends Declaration, ControlFlowNode, AccessHolder, @function {
|
||||
* block, this gives the block guarded by the try statement. See
|
||||
* `FunctionTryStmt` for further information.
|
||||
*/
|
||||
Block getBlock() { result.getParentScope() = this }
|
||||
BlockStmt getBlock() { result.getParentScope() = this }
|
||||
|
||||
/** Holds if this function has an entry point. */
|
||||
predicate hasEntryPoint() { exists(getEntryPoint()) }
|
||||
@@ -276,7 +276,7 @@ class Function extends Declaration, ControlFlowNode, AccessHolder, @function {
|
||||
/**
|
||||
* Gets the first node in this function's control flow graph.
|
||||
*
|
||||
* For most functions, this first node will be the `Block` returned by
|
||||
* For most functions, this first node will be the `BlockStmt` returned by
|
||||
* `getBlock`. However in C++, the first node can also be a
|
||||
* `FunctionTryStmt`.
|
||||
*/
|
||||
@@ -564,7 +564,7 @@ class FunctionDeclarationEntry extends DeclarationEntry, @fun_decl {
|
||||
* If this is a function definition, get the block containing the
|
||||
* function body.
|
||||
*/
|
||||
Block getBlock() {
|
||||
BlockStmt getBlock() {
|
||||
this.isDefinition() and
|
||||
result = getFunction().getBlock() and
|
||||
result.getFile() = this.getFile()
|
||||
@@ -576,7 +576,7 @@ class FunctionDeclarationEntry extends DeclarationEntry, @fun_decl {
|
||||
*/
|
||||
pragma[noopt]
|
||||
int getNumberOfLines() {
|
||||
exists(Block b, Location l, int start, int end, int diff | b = getBlock() |
|
||||
exists(BlockStmt b, Location l, int start, int end, int diff | b = getBlock() |
|
||||
l = b.getLocation() and
|
||||
start = l.getStartLine() and
|
||||
end = l.getEndLine() and
|
||||
|
||||
@@ -136,7 +136,7 @@ deprecated class ObjcTryStmt extends TryStmt {
|
||||
* DEPRECATED: Objective-C is no longer supported.
|
||||
* An Objective C `@finally` block.
|
||||
*/
|
||||
deprecated class FinallyBlock extends Block {
|
||||
deprecated class FinallyBlock extends BlockStmt {
|
||||
FinallyBlock() { none() }
|
||||
|
||||
/** Gets the try statement corresponding to this finally block. */
|
||||
|
||||
@@ -98,7 +98,7 @@ class Parameter extends LocalScopeVariable, @parameter {
|
||||
* DEPRECATED: this method was used in a previous implementation of
|
||||
* getName, but is no longer in use.
|
||||
*/
|
||||
deprecated string getNameInBlock(Block b) {
|
||||
deprecated string getNameInBlock(BlockStmt b) {
|
||||
exists(ParameterDeclarationEntry pde |
|
||||
pde.getFunctionDeclarationEntry().getBlock() = b and
|
||||
this.getFunction().getBlock() = b and
|
||||
@@ -127,7 +127,7 @@ class Parameter extends LocalScopeVariable, @parameter {
|
||||
* Gets the catch block to which this parameter belongs, if it is a catch
|
||||
* block parameter.
|
||||
*/
|
||||
Block getCatchBlock() { params(underlyingElement(this), unresolveElement(result), _, _) }
|
||||
BlockStmt getCatchBlock() { params(underlyingElement(this), unresolveElement(result), _, _) }
|
||||
|
||||
/**
|
||||
* Gets the zero-based index of this parameter.
|
||||
|
||||
@@ -25,7 +25,7 @@ private predicate exprInVoidContext(Expr e) {
|
||||
(
|
||||
exists(ExprStmt s |
|
||||
s = e.getParent() and
|
||||
not exists(StmtExpr se | s = se.getStmt().(Block).getLastStmt())
|
||||
not exists(StmtExpr se | s = se.getStmt().(BlockStmt).getLastStmt())
|
||||
)
|
||||
or
|
||||
exists(ConditionalExpr c | c.getThen() = e and c instanceof ExprInVoidContext)
|
||||
|
||||
@@ -118,7 +118,7 @@ private predicate excludeNodeAndNodesBelow(Expr e) {
|
||||
or
|
||||
// Constructor init lists should be evaluated, and we can change this in
|
||||
// the future, but it would mean that a `Function` entry point is not
|
||||
// always a `Block` or `FunctionTryStmt`.
|
||||
// always a `BlockStmt` or `FunctionTryStmt`.
|
||||
e instanceof ConstructorInit
|
||||
or
|
||||
// Destructor field destructions should also be hooked into the CFG
|
||||
@@ -408,10 +408,10 @@ private Node getControlOrderChildSparse(Node n, int i) {
|
||||
// in-line in the block containing their corresponding DeclStmt but should
|
||||
// not be evaluated in the order implied by their position in the block. We
|
||||
// do the following.
|
||||
// - Block skips all the VlaDeclStmt and VlaDimensionStmt children.
|
||||
// - BlockStmt skips all the VlaDeclStmt and VlaDimensionStmt children.
|
||||
// - VlaDeclStmt is inserted as a child of DeclStmt
|
||||
// - VlaDimensionStmt is inserted as a child of VlaDeclStmt
|
||||
result = n.(Block).getChild(i) and
|
||||
result = n.(BlockStmt).getChild(i) and
|
||||
not result instanceof VlaDeclStmt and
|
||||
not result instanceof VlaDimensionStmt
|
||||
or
|
||||
@@ -557,7 +557,7 @@ private class Spec extends Pos {
|
||||
*/
|
||||
private predicate straightLineSparse(Node scope, int i, Node ni, Spec spec) {
|
||||
scope =
|
||||
any(Block b |
|
||||
any(BlockStmt b |
|
||||
i = -1 and ni = b and spec.isAt()
|
||||
or
|
||||
if exists(getLastControlOrderChild(b))
|
||||
@@ -734,7 +734,7 @@ private predicate straightLineSparse(Node scope, int i, Node ni, Spec spec) {
|
||||
or
|
||||
// If the switch body is not a block then this step is skipped, and the
|
||||
// expression jumps directly to the cases.
|
||||
i = 1 and ni = s.getStmt().(Block) and spec.isAt()
|
||||
i = 1 and ni = s.getStmt().(BlockStmt) and spec.isAt()
|
||||
or
|
||||
i = 2 and ni = s.getASwitchCase() and spec.isBefore()
|
||||
or
|
||||
@@ -1010,7 +1010,7 @@ private predicate subEdgeIncludingDestructors(Pos p1, Node n1, Node n2, Pos p2)
|
||||
* The exact placement of that call in the CFG depends on the type of
|
||||
* `node` as follows:
|
||||
*
|
||||
* - `Block`: after ordinary control flow falls off the end of the block
|
||||
* - `BlockStmt`: after ordinary control flow falls off the end of the block
|
||||
* without jumps or exceptions.
|
||||
* - `ReturnStmt`: After the statement itself or after its operand (if
|
||||
* present).
|
||||
|
||||
@@ -182,7 +182,7 @@ private int switchCaseRangeEnd(SwitchCase sc) {
|
||||
* body `switchBlock`. There may be several such expressions: for example, if
|
||||
* the condition is `(x ? y : z)` then the result is {`y`, `z`}.
|
||||
*/
|
||||
private Node getASwitchExpr(SwitchStmt switch, Block switchBlock) {
|
||||
private Node getASwitchExpr(SwitchStmt switch, BlockStmt switchBlock) {
|
||||
switch.getStmt() = switchBlock and
|
||||
successors_extended(result, switchBlock)
|
||||
}
|
||||
@@ -192,7 +192,7 @@ private Node getASwitchExpr(SwitchStmt switch, Block switchBlock) {
|
||||
* from `switchBlock` to `sc` is impossible. This considers only non-`default`
|
||||
* switch cases.
|
||||
*/
|
||||
private predicate impossibleSwitchEdge(Block switchBlock, SwitchCase sc) {
|
||||
private predicate impossibleSwitchEdge(BlockStmt switchBlock, SwitchCase sc) {
|
||||
not sc instanceof DefaultCase and
|
||||
exists(SwitchStmt switch |
|
||||
switch = sc.getSwitchStmt() and
|
||||
@@ -215,7 +215,7 @@ private predicate impossibleSwitchEdge(Block switchBlock, SwitchCase sc) {
|
||||
* If a switch provably always chooses a non-default case, then the edge to
|
||||
* the default case is impossible.
|
||||
*/
|
||||
private predicate impossibleDefaultSwitchEdge(Block switchBlock, DefaultCase dc) {
|
||||
private predicate impossibleDefaultSwitchEdge(BlockStmt switchBlock, DefaultCase dc) {
|
||||
exists(SwitchStmt switch |
|
||||
switch = dc.getSwitchStmt() and
|
||||
switch.getStmt() = switchBlock and
|
||||
|
||||
@@ -33,10 +33,10 @@ predicate defaultAdditionalTaintStep(DataFlow::Node src, DataFlow::Node sink) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `node` should be a barrier in all global taint flow configurations
|
||||
* Holds if `node` should be a sanitizer in all global taint flow configurations
|
||||
* but not in local taint.
|
||||
*/
|
||||
predicate defaultTaintBarrier(DataFlow::Node node) { none() }
|
||||
predicate defaultTaintSanitizer(DataFlow::Node node) { none() }
|
||||
|
||||
/**
|
||||
* Holds if taint can flow in one local step from `nodeFrom` to `nodeTo` excluding
|
||||
@@ -90,10 +90,17 @@ predicate localAdditionalTaintStep(DataFlow::Node nodeFrom, DataFlow::Node nodeT
|
||||
exists(TaintFunction f, Call call, FunctionInput inModel, FunctionOutput outModel |
|
||||
call.getTarget() = f and
|
||||
inModel.isReturnValueDeref() and
|
||||
outModel.isQualifierObject() and
|
||||
f.hasTaintFlow(inModel, outModel) and
|
||||
nodeFrom.(DataFlow::PostUpdateNode).getPreUpdateNode().asExpr() = call and
|
||||
nodeTo.asDefiningArgument() = call.getQualifier()
|
||||
f.hasTaintFlow(inModel, outModel) and
|
||||
(
|
||||
outModel.isQualifierObject() and
|
||||
nodeTo.asDefiningArgument() = call.getQualifier()
|
||||
or
|
||||
exists(int argOutIndex |
|
||||
outModel.isParameterDeref(argOutIndex) and
|
||||
nodeTo.asDefiningArgument() = call.getArgument(argOutIndex)
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -76,20 +76,20 @@ abstract class Configuration extends DataFlow::Configuration {
|
||||
|
||||
final override predicate isBarrier(DataFlow::Node node) {
|
||||
isSanitizer(node) or
|
||||
defaultTaintBarrier(node)
|
||||
defaultTaintSanitizer(node)
|
||||
}
|
||||
|
||||
/** Holds if data flow into `node` is prohibited. */
|
||||
/** Holds if taint propagation into `node` is prohibited. */
|
||||
predicate isSanitizerIn(DataFlow::Node node) { none() }
|
||||
|
||||
final override predicate isBarrierIn(DataFlow::Node node) { isSanitizerIn(node) }
|
||||
|
||||
/** Holds if data flow out of `node` is prohibited. */
|
||||
/** Holds if taint propagation out of `node` is prohibited. */
|
||||
predicate isSanitizerOut(DataFlow::Node node) { none() }
|
||||
|
||||
final override predicate isBarrierOut(DataFlow::Node node) { isSanitizerOut(node) }
|
||||
|
||||
/** Holds if data flow through nodes guarded by `guard` is prohibited. */
|
||||
/** Holds if taint propagation through nodes guarded by `guard` is prohibited. */
|
||||
predicate isSanitizerGuard(DataFlow::BarrierGuard guard) { none() }
|
||||
|
||||
final override predicate isBarrierGuard(DataFlow::BarrierGuard guard) { isSanitizerGuard(guard) }
|
||||
|
||||
@@ -76,20 +76,20 @@ abstract class Configuration extends DataFlow::Configuration {
|
||||
|
||||
final override predicate isBarrier(DataFlow::Node node) {
|
||||
isSanitizer(node) or
|
||||
defaultTaintBarrier(node)
|
||||
defaultTaintSanitizer(node)
|
||||
}
|
||||
|
||||
/** Holds if data flow into `node` is prohibited. */
|
||||
/** Holds if taint propagation into `node` is prohibited. */
|
||||
predicate isSanitizerIn(DataFlow::Node node) { none() }
|
||||
|
||||
final override predicate isBarrierIn(DataFlow::Node node) { isSanitizerIn(node) }
|
||||
|
||||
/** Holds if data flow out of `node` is prohibited. */
|
||||
/** Holds if taint propagation out of `node` is prohibited. */
|
||||
predicate isSanitizerOut(DataFlow::Node node) { none() }
|
||||
|
||||
final override predicate isBarrierOut(DataFlow::Node node) { isSanitizerOut(node) }
|
||||
|
||||
/** Holds if data flow through nodes guarded by `guard` is prohibited. */
|
||||
/** Holds if taint propagation through nodes guarded by `guard` is prohibited. */
|
||||
predicate isSanitizerGuard(DataFlow::BarrierGuard guard) { none() }
|
||||
|
||||
final override predicate isBarrierGuard(DataFlow::BarrierGuard guard) { isSanitizerGuard(guard) }
|
||||
|
||||
@@ -27,7 +27,7 @@ class Expr extends StmtParent, @expr {
|
||||
Function getEnclosingFunction() { result = exprEnclosingElement(this) }
|
||||
|
||||
/** Gets the nearest enclosing set of curly braces around this expression in the source, if any. */
|
||||
Block getEnclosingBlock() { result = getEnclosingStmt().getEnclosingBlock() }
|
||||
BlockStmt getEnclosingBlock() { result = getEnclosingStmt().getEnclosingBlock() }
|
||||
|
||||
override Stmt getEnclosingStmt() {
|
||||
result = this.getParent().(Expr).getEnclosingStmt()
|
||||
@@ -402,7 +402,7 @@ class Expr extends StmtParent, @expr {
|
||||
*/
|
||||
predicate hasImplicitConversion() {
|
||||
exists(Expr e |
|
||||
exprconv(underlyingElement(this), unresolveElement(e)) and e.(Cast).isImplicit()
|
||||
exprconv(underlyingElement(this), unresolveElement(e)) and e.(Conversion).isImplicit()
|
||||
)
|
||||
}
|
||||
|
||||
@@ -414,7 +414,7 @@ class Expr extends StmtParent, @expr {
|
||||
*/
|
||||
predicate hasExplicitConversion() {
|
||||
exists(Expr e |
|
||||
exprconv(underlyingElement(this), unresolveElement(e)) and not e.(Cast).isImplicit()
|
||||
exprconv(underlyingElement(this), unresolveElement(e)) and not e.(Conversion).isImplicit()
|
||||
)
|
||||
}
|
||||
|
||||
@@ -453,12 +453,14 @@ class Expr extends StmtParent, @expr {
|
||||
* cast from B to C. Only (1) and (2) would be included.
|
||||
*/
|
||||
Expr getExplicitlyConverted() {
|
||||
// result is this or one of its conversions
|
||||
result = this.getConversion*() and
|
||||
// result is not an implicit conversion - it's either the expr or an explicit cast
|
||||
(result = this or not result.(Cast).isImplicit()) and
|
||||
// there is no further explicit conversion after result
|
||||
not exists(Cast other | other = result.getConversion+() and not other.isImplicit())
|
||||
// For performance, we avoid a full transitive closure over `getConversion`.
|
||||
// Since there can be several implicit conversions before and after an
|
||||
// explicit conversion, use `getImplicitlyConverted` to step over them
|
||||
// cheaply. Then, if there is an explicit conversion following the implict
|
||||
// conversion sequence, recurse to handle multiple explicit conversions.
|
||||
if this.getImplicitlyConverted().hasExplicitConversion()
|
||||
then result = this.getImplicitlyConverted().getConversion().getExplicitlyConverted()
|
||||
else result = this
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1109,7 +1111,7 @@ class StmtExpr extends Expr, @expr_stmt {
|
||||
/** Get the result expression of a statement. (Helper function for StmtExpr.) */
|
||||
private Expr getStmtResultExpr(Stmt stmt) {
|
||||
result = stmt.(ExprStmt).getExpr() or
|
||||
result = getStmtResultExpr(stmt.(Block).getLastStmt())
|
||||
result = getStmtResultExpr(stmt.(BlockStmt).getLastStmt())
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -100,10 +100,10 @@ predicate defaultAdditionalTaintStep(DataFlow::Node src, DataFlow::Node sink) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `node` should be a barrier in all global taint flow configurations
|
||||
* Holds if `node` should be a sanitizer in all global taint flow configurations
|
||||
* but not in local taint.
|
||||
*/
|
||||
predicate defaultTaintBarrier(DataFlow::Node node) { none() }
|
||||
predicate defaultTaintSanitizer(DataFlow::Node node) { none() }
|
||||
|
||||
/**
|
||||
* Holds if taint can flow from `instrIn` to `instrOut` through a call to a
|
||||
|
||||
@@ -76,20 +76,20 @@ abstract class Configuration extends DataFlow::Configuration {
|
||||
|
||||
final override predicate isBarrier(DataFlow::Node node) {
|
||||
isSanitizer(node) or
|
||||
defaultTaintBarrier(node)
|
||||
defaultTaintSanitizer(node)
|
||||
}
|
||||
|
||||
/** Holds if data flow into `node` is prohibited. */
|
||||
/** Holds if taint propagation into `node` is prohibited. */
|
||||
predicate isSanitizerIn(DataFlow::Node node) { none() }
|
||||
|
||||
final override predicate isBarrierIn(DataFlow::Node node) { isSanitizerIn(node) }
|
||||
|
||||
/** Holds if data flow out of `node` is prohibited. */
|
||||
/** Holds if taint propagation out of `node` is prohibited. */
|
||||
predicate isSanitizerOut(DataFlow::Node node) { none() }
|
||||
|
||||
final override predicate isBarrierOut(DataFlow::Node node) { isSanitizerOut(node) }
|
||||
|
||||
/** Holds if data flow through nodes guarded by `guard` is prohibited. */
|
||||
/** Holds if taint propagation through nodes guarded by `guard` is prohibited. */
|
||||
predicate isSanitizerGuard(DataFlow::BarrierGuard guard) { none() }
|
||||
|
||||
final override predicate isBarrierGuard(DataFlow::BarrierGuard guard) { isSanitizerGuard(guard) }
|
||||
|
||||
@@ -76,20 +76,20 @@ abstract class Configuration extends DataFlow::Configuration {
|
||||
|
||||
final override predicate isBarrier(DataFlow::Node node) {
|
||||
isSanitizer(node) or
|
||||
defaultTaintBarrier(node)
|
||||
defaultTaintSanitizer(node)
|
||||
}
|
||||
|
||||
/** Holds if data flow into `node` is prohibited. */
|
||||
/** Holds if taint propagation into `node` is prohibited. */
|
||||
predicate isSanitizerIn(DataFlow::Node node) { none() }
|
||||
|
||||
final override predicate isBarrierIn(DataFlow::Node node) { isSanitizerIn(node) }
|
||||
|
||||
/** Holds if data flow out of `node` is prohibited. */
|
||||
/** Holds if taint propagation out of `node` is prohibited. */
|
||||
predicate isSanitizerOut(DataFlow::Node node) { none() }
|
||||
|
||||
final override predicate isBarrierOut(DataFlow::Node node) { isSanitizerOut(node) }
|
||||
|
||||
/** Holds if data flow through nodes guarded by `guard` is prohibited. */
|
||||
/** Holds if taint propagation through nodes guarded by `guard` is prohibited. */
|
||||
predicate isSanitizerGuard(DataFlow::BarrierGuard guard) { none() }
|
||||
|
||||
final override predicate isBarrierGuard(DataFlow::BarrierGuard guard) { isSanitizerGuard(guard) }
|
||||
|
||||
@@ -2905,7 +2905,7 @@ predicate exprNeedsCopyIfNotLoaded(Expr expr) {
|
||||
private predicate exprImmediatelyDiscarded(Expr expr) {
|
||||
exists(ExprStmt s |
|
||||
s = expr.getParent() and
|
||||
not exists(StmtExpr se | s = se.getStmt().(Block).getLastStmt())
|
||||
not exists(StmtExpr se | s = se.getStmt().(BlockStmt).getLastStmt())
|
||||
)
|
||||
or
|
||||
exists(CommaExpr c | c.getLeftOperand() = expr)
|
||||
|
||||
@@ -290,7 +290,7 @@ class TranslatedTryStmt extends TranslatedStmt {
|
||||
}
|
||||
|
||||
class TranslatedBlock extends TranslatedStmt {
|
||||
override Block stmt;
|
||||
override BlockStmt stmt;
|
||||
|
||||
override TranslatedElement getChild(int id) { result = getStmt(id) }
|
||||
|
||||
|
||||
@@ -334,7 +334,7 @@ private predicate branchingExpr(Expr expr) {
|
||||
* Gets the number of branching statements and expressions in a block. This is
|
||||
* for computing cyclomatic complexity.
|
||||
*/
|
||||
int cyclomaticComplexityBranches(Block b) {
|
||||
int cyclomaticComplexityBranches(BlockStmt b) {
|
||||
result =
|
||||
count(Stmt stmt |
|
||||
branchingStmt(stmt) and
|
||||
@@ -373,7 +373,7 @@ private predicate skipParent(Stmt s) {
|
||||
exists(Stmt parent | parent = s.getParentStmt() |
|
||||
s instanceof IfStmt and parent.(IfStmt).getElse() = s
|
||||
or
|
||||
parent instanceof Block
|
||||
parent instanceof BlockStmt
|
||||
or
|
||||
exists(File f, int startLine, int startCol |
|
||||
startsAt(s, f, startLine, startCol) and
|
||||
|
||||
@@ -18,3 +18,4 @@ private import implementations.StdContainer
|
||||
private import implementations.StdString
|
||||
private import implementations.Swap
|
||||
private import implementations.GetDelim
|
||||
private import implementations.SmartPointer
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
import semmle.code.cpp.models.interfaces.Taint
|
||||
|
||||
/**
|
||||
* The `std::shared_ptr` and `std::unique_ptr` template classes.
|
||||
*/
|
||||
class UniqueOrSharedPtr extends Class {
|
||||
UniqueOrSharedPtr() { this.hasQualifiedName("std", ["shared_ptr", "unique_ptr"]) }
|
||||
}
|
||||
|
||||
/**
|
||||
* The `std::make_shared` and `std::make_unique` template functions.
|
||||
*/
|
||||
class MakeUniqueOrShared extends TaintFunction {
|
||||
MakeUniqueOrShared() { this.hasQualifiedName("std", ["make_shared", "make_unique"]) }
|
||||
|
||||
override predicate hasTaintFlow(FunctionInput input, FunctionOutput output) {
|
||||
// Exclude the specializations of `std::make_shared` and `std::make_unique` that allocate arrays
|
||||
// since these just take a size argument, which we don't want to propagate taint through.
|
||||
not this.isArray() and
|
||||
input.isParameter(_) and
|
||||
output.isReturnValue()
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if the function returns a `shared_ptr<T>` (or `unique_ptr<T>`) where `T` is an
|
||||
* array type (i.e., `U[]` for some type `U`).
|
||||
*/
|
||||
predicate isArray() {
|
||||
this.getTemplateArgument(0).(Type).getUnderlyingType() instanceof ArrayType
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A prefix `operator*` member function for a `shared_ptr` or `unique_ptr` type.
|
||||
*/
|
||||
class UniqueOrSharedDereferenceMemberOperator extends MemberFunction, TaintFunction {
|
||||
UniqueOrSharedDereferenceMemberOperator() {
|
||||
this.hasName("operator*") and
|
||||
this.getDeclaringType() instanceof UniqueOrSharedPtr
|
||||
}
|
||||
|
||||
override predicate hasTaintFlow(FunctionInput input, FunctionOutput output) {
|
||||
input.isQualifierObject() and
|
||||
output.isReturnValueDeref()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The `std::shared_ptr` or `std::unique_ptr` function `get`.
|
||||
*/
|
||||
class UniqueOrSharedGet extends TaintFunction {
|
||||
UniqueOrSharedGet() {
|
||||
this.hasName("get") and
|
||||
this.getDeclaringType() instanceof UniqueOrSharedPtr
|
||||
}
|
||||
|
||||
override predicate hasTaintFlow(FunctionInput input, FunctionOutput output) {
|
||||
input.isQualifierObject() and
|
||||
output.isReturnValue()
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Provides implementation classes modeling `std::string` and other
|
||||
* instantiations of `std::basic_string`. See `semmle.code.cpp.models.Models`
|
||||
* for usage information.
|
||||
* Provides implementation classes modeling `std::string` (and other
|
||||
* instantiations of `std::basic_string`) and `std::ostream`. See
|
||||
* `semmle.code.cpp.models.Models` for usage information.
|
||||
*/
|
||||
|
||||
import semmle.code.cpp.models.interfaces.Taint
|
||||
@@ -287,3 +287,68 @@ class StdStringAt extends TaintFunction {
|
||||
output.isQualifierObject()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The `std::basic_ostream` template class.
|
||||
*/
|
||||
class StdBasicOStream extends TemplateClass {
|
||||
StdBasicOStream() { this.hasQualifiedName("std", "basic_ostream") }
|
||||
}
|
||||
|
||||
/**
|
||||
* The `std::ostream` function `operator<<` (defined as a member function).
|
||||
*/
|
||||
class StdOStreamOut extends DataFlowFunction, TaintFunction {
|
||||
StdOStreamOut() { this.hasQualifiedName("std", "basic_ostream", "operator<<") }
|
||||
|
||||
override predicate hasDataFlow(FunctionInput input, FunctionOutput output) {
|
||||
// flow from qualifier to return value
|
||||
input.isQualifierAddress() and
|
||||
output.isReturnValue()
|
||||
}
|
||||
|
||||
override predicate hasTaintFlow(FunctionInput input, FunctionOutput output) {
|
||||
// flow from parameter to qualifier
|
||||
input.isParameter(0) and
|
||||
output.isQualifierObject()
|
||||
or
|
||||
// flow from parameter to return value
|
||||
input.isParameter(0) and
|
||||
output.isReturnValueDeref()
|
||||
or
|
||||
// reverse flow from returned reference to the qualifier
|
||||
input.isReturnValueDeref() and
|
||||
output.isQualifierObject()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The `std::ostream` function `operator<<` (defined as a non-member function).
|
||||
*/
|
||||
class StdOStreamOutNonMember extends DataFlowFunction, TaintFunction {
|
||||
StdOStreamOutNonMember() {
|
||||
this.hasQualifiedName("std", "operator<<") and
|
||||
this.getUnspecifiedType().(ReferenceType).getBaseType() =
|
||||
any(StdBasicOStream s).getAnInstantiation()
|
||||
}
|
||||
|
||||
override predicate hasDataFlow(FunctionInput input, FunctionOutput output) {
|
||||
// flow from first parameter to return value
|
||||
input.isParameter(0) and
|
||||
output.isReturnValue()
|
||||
}
|
||||
|
||||
override predicate hasTaintFlow(FunctionInput input, FunctionOutput output) {
|
||||
// flow from second parameter to first parameter
|
||||
input.isParameter(1) and
|
||||
output.isParameterDeref(0)
|
||||
or
|
||||
// flow from second parameter to return value
|
||||
input.isParameter(1) and
|
||||
output.isReturnValueDeref()
|
||||
or
|
||||
// reverse flow from returned reference to the first parameter
|
||||
input.isReturnValueDeref() and
|
||||
output.isParameterDeref(0)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,6 +171,65 @@ predicate eqOpWithSwapAndNegate(EqualityOperation cmp, Expr a, Expr b, boolean i
|
||||
eqOpWithSwap(cmp, a, b, branch.booleanNot()) and isEQ = false
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `cmp` is an unconverted conversion of `a` to a Boolean that
|
||||
* evalutes to `isEQ` iff `a` is 0.
|
||||
*
|
||||
* Note that `a` can be `cmp` itself or a conversion thereof.
|
||||
*/
|
||||
private predicate eqZero(Expr cmp, Expr a, boolean isEQ) {
|
||||
// The `!a` expression tests `a` equal to zero when `a` is a number converted
|
||||
// to a Boolean.
|
||||
isEQ = true and
|
||||
exists(Expr notOperand | notOperand = cmp.(NotExpr).getOperand().getFullyConverted() |
|
||||
// In C++ code there will be a BoolConversion in `!myInt`
|
||||
a = notOperand.(BoolConversion).getExpr()
|
||||
or
|
||||
// In C code there is no conversion since there was no bool type before C99
|
||||
a = notOperand and
|
||||
not a instanceof BoolConversion // avoid overlap with the case above
|
||||
)
|
||||
or
|
||||
// The `(bool)a` expression tests `a` NOT equal to zero when `a` is a number
|
||||
// converted to a Boolean. To avoid overlap with the case above, this case
|
||||
// excludes conversions that are right below a `!`.
|
||||
isEQ = false and
|
||||
linearAccess(cmp, _, _, _) and
|
||||
// This test for `isCondition` implies that `cmp` is unconverted and that the
|
||||
// parent of `cfg` is not a `NotExpr` -- the CFG doesn't do branching from
|
||||
// inside `NotExpr`.
|
||||
cmp.isCondition() and
|
||||
// The GNU two-operand conditional expression is not supported for the
|
||||
// purpose of guards, but the value of the conditional expression itself is
|
||||
// modeled in the range analysis.
|
||||
not exists(ConditionalExpr cond | cmp = cond.getCondition() and cond.isTwoOperand()) and
|
||||
(
|
||||
// In C++ code there will be a BoolConversion in `if (myInt)`
|
||||
a = cmp.getFullyConverted().(BoolConversion).getExpr()
|
||||
or
|
||||
// In C code there is no conversion since there was no bool type before C99
|
||||
a = cmp.getFullyConverted() and
|
||||
not a instanceof BoolConversion // avoid overlap with the case above
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `branch` of `cmp` is taken when `a` compares `isEQ` to zero.
|
||||
*
|
||||
* Note that `a` can be `cmp` itself or a conversion thereof.
|
||||
*/
|
||||
predicate eqZeroWithNegate(Expr cmp, Expr a, boolean isEQ, boolean branch) {
|
||||
// The comparison for _equality_ to zero is on the `true` branch when `cmp`
|
||||
// compares equal to zero and on the `false` branch when `cmp` compares not
|
||||
// equal to zero.
|
||||
eqZero(cmp, a, branch) and isEQ = true
|
||||
or
|
||||
// The comparison for _inequality_ to zero is on the `false` branch when
|
||||
// `cmp` compares equal to zero and on the `true` branch when `cmp` compares
|
||||
// not equal to zero.
|
||||
eqZero(cmp, a, branch.booleanNot()) and isEQ = false
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `expr` is equivalent to `p*v + q`, where `p` is a non-zero
|
||||
* number. This takes into account the associativity, commutativity and
|
||||
|
||||
@@ -40,21 +40,20 @@ library class RangeSSA extends SSAHelper {
|
||||
}
|
||||
}
|
||||
|
||||
private predicate guard_defn(
|
||||
VariableAccess v, ComparisonOperation guard, BasicBlock b, boolean branch
|
||||
) {
|
||||
private predicate guard_defn(VariableAccess v, Expr guard, BasicBlock b, boolean branch) {
|
||||
guardCondition(guard, v, branch) and
|
||||
guardSuccessor(guard, branch, b)
|
||||
}
|
||||
|
||||
private predicate guardCondition(ComparisonOperation guard, VariableAccess v, boolean branch) {
|
||||
private predicate guardCondition(Expr guard, VariableAccess v, boolean branch) {
|
||||
exists(Expr lhs | linearAccess(lhs, v, _, _) |
|
||||
relOpWithSwapAndNegate(guard, lhs, _, _, _, branch) or
|
||||
eqOpWithSwapAndNegate(guard, lhs, _, _, branch)
|
||||
eqOpWithSwapAndNegate(guard, lhs, _, _, branch) or
|
||||
eqZeroWithNegate(guard, lhs, _, branch)
|
||||
)
|
||||
}
|
||||
|
||||
private predicate guardSuccessor(ComparisonOperation guard, boolean branch, BasicBlock succ) {
|
||||
private predicate guardSuccessor(Expr guard, boolean branch, BasicBlock succ) {
|
||||
branch = true and succ = guard.getATrueSuccessor()
|
||||
or
|
||||
branch = false and succ = guard.getAFalseSuccessor()
|
||||
@@ -98,7 +97,7 @@ class RangeSsaDefinition extends ControlFlowNodeBase {
|
||||
* If this definition is a phi node corresponding to a guard,
|
||||
* then return the variable and the guard.
|
||||
*/
|
||||
predicate isGuardPhi(VariableAccess v, ComparisonOperation guard, boolean branch) {
|
||||
predicate isGuardPhi(VariableAccess v, Expr guard, boolean branch) {
|
||||
guard_defn(v, guard, this, branch)
|
||||
}
|
||||
|
||||
|
||||
@@ -427,11 +427,11 @@ private predicate exprDependsOnDef(Expr e, RangeSsaDefinition srcDef, StackVaria
|
||||
private predicate phiDependsOnDef(
|
||||
RangeSsaDefinition phi, StackVariable v, RangeSsaDefinition srcDef, StackVariable srcVar
|
||||
) {
|
||||
exists(VariableAccess access, ComparisonOperation guard |
|
||||
exists(VariableAccess access, Expr guard |
|
||||
access = v.getAnAccess() and
|
||||
phi.isGuardPhi(access, guard, _)
|
||||
|
|
||||
exprDependsOnDef(guard.getAnOperand(), srcDef, srcVar) or
|
||||
exprDependsOnDef(guard.(ComparisonOperation).getAnOperand(), srcDef, srcVar) or
|
||||
exprDependsOnDef(access, srcDef, srcVar)
|
||||
)
|
||||
or
|
||||
@@ -1132,9 +1132,7 @@ private float boolConversionUpperBound(Expr expr) {
|
||||
* use the guard to deduce that the lower bound is 2 inside the block.
|
||||
*/
|
||||
private float getPhiLowerBounds(StackVariable v, RangeSsaDefinition phi) {
|
||||
exists(
|
||||
VariableAccess access, ComparisonOperation guard, boolean branch, float defLB, float guardLB
|
||||
|
|
||||
exists(VariableAccess access, Expr guard, boolean branch, float defLB, float guardLB |
|
||||
access = v.getAnAccess() and
|
||||
phi.isGuardPhi(access, guard, branch) and
|
||||
lowerBoundFromGuard(guard, access, guardLB, branch) and
|
||||
@@ -1146,13 +1144,13 @@ private float getPhiLowerBounds(StackVariable v, RangeSsaDefinition phi) {
|
||||
or
|
||||
exists(VariableAccess access, float neConstant, float lower |
|
||||
isNEPhi(v, phi, access, neConstant) and
|
||||
lower = getFullyConvertedLowerBounds(access) and
|
||||
lower = getTruncatedLowerBounds(access) and
|
||||
if lower = neConstant then result = lower + 1 else result = lower
|
||||
)
|
||||
or
|
||||
exists(VariableAccess access |
|
||||
isUnsupportedGuardPhi(v, phi, access) and
|
||||
result = getFullyConvertedLowerBounds(access)
|
||||
result = getTruncatedLowerBounds(access)
|
||||
)
|
||||
or
|
||||
result = getDefLowerBounds(phi.getAPhiInput(v), v)
|
||||
@@ -1160,9 +1158,7 @@ private float getPhiLowerBounds(StackVariable v, RangeSsaDefinition phi) {
|
||||
|
||||
/** See comment for `getPhiLowerBounds`, above. */
|
||||
private float getPhiUpperBounds(StackVariable v, RangeSsaDefinition phi) {
|
||||
exists(
|
||||
VariableAccess access, ComparisonOperation guard, boolean branch, float defUB, float guardUB
|
||||
|
|
||||
exists(VariableAccess access, Expr guard, boolean branch, float defUB, float guardUB |
|
||||
access = v.getAnAccess() and
|
||||
phi.isGuardPhi(access, guard, branch) and
|
||||
upperBoundFromGuard(guard, access, guardUB, branch) and
|
||||
@@ -1174,13 +1170,13 @@ private float getPhiUpperBounds(StackVariable v, RangeSsaDefinition phi) {
|
||||
or
|
||||
exists(VariableAccess access, float neConstant, float upper |
|
||||
isNEPhi(v, phi, access, neConstant) and
|
||||
upper = getFullyConvertedUpperBounds(access) and
|
||||
upper = getTruncatedUpperBounds(access) and
|
||||
if upper = neConstant then result = upper - 1 else result = upper
|
||||
)
|
||||
or
|
||||
exists(VariableAccess access |
|
||||
isUnsupportedGuardPhi(v, phi, access) and
|
||||
result = getFullyConvertedUpperBounds(access)
|
||||
result = getTruncatedUpperBounds(access)
|
||||
)
|
||||
or
|
||||
result = getDefUpperBounds(phi.getAPhiInput(v), v)
|
||||
@@ -1334,7 +1330,7 @@ private predicate unanalyzableDefBounds(RangeSsaDefinition def, StackVariable v,
|
||||
* inferences about `v`.
|
||||
*/
|
||||
bindingset[guard, v, branch]
|
||||
predicate nonNanGuardedVariable(ComparisonOperation guard, VariableAccess v, boolean branch) {
|
||||
predicate nonNanGuardedVariable(Expr guard, VariableAccess v, boolean branch) {
|
||||
getVariableRangeType(v.getTarget()) instanceof IntegralType
|
||||
or
|
||||
getVariableRangeType(v.getTarget()) instanceof FloatingPointType and
|
||||
@@ -1353,9 +1349,7 @@ predicate nonNanGuardedVariable(ComparisonOperation guard, VariableAccess v, boo
|
||||
* predicate uses the bounds information for `r` to compute a lower bound
|
||||
* for `v`.
|
||||
*/
|
||||
private predicate lowerBoundFromGuard(
|
||||
ComparisonOperation guard, VariableAccess v, float lb, boolean branch
|
||||
) {
|
||||
private predicate lowerBoundFromGuard(Expr guard, VariableAccess v, float lb, boolean branch) {
|
||||
exists(float childLB, RelationStrictness strictness |
|
||||
boundFromGuard(guard, v, childLB, true, strictness, branch)
|
||||
|
|
||||
@@ -1375,9 +1369,7 @@ private predicate lowerBoundFromGuard(
|
||||
* predicate uses the bounds information for `r` to compute a upper bound
|
||||
* for `v`.
|
||||
*/
|
||||
private predicate upperBoundFromGuard(
|
||||
ComparisonOperation guard, VariableAccess v, float ub, boolean branch
|
||||
) {
|
||||
private predicate upperBoundFromGuard(Expr guard, VariableAccess v, float ub, boolean branch) {
|
||||
exists(float childUB, RelationStrictness strictness |
|
||||
boundFromGuard(guard, v, childUB, false, strictness, branch)
|
||||
|
|
||||
@@ -1397,7 +1389,7 @@ private predicate upperBoundFromGuard(
|
||||
* `linearBoundFromGuard`.
|
||||
*/
|
||||
private predicate boundFromGuard(
|
||||
ComparisonOperation guard, VariableAccess v, float boundValue, boolean isLowerBound,
|
||||
Expr guard, VariableAccess v, float boundValue, boolean isLowerBound,
|
||||
RelationStrictness strictness, boolean branch
|
||||
) {
|
||||
exists(float p, float q, float r, boolean isLB |
|
||||
@@ -1410,6 +1402,15 @@ private predicate boundFromGuard(
|
||||
or
|
||||
p < 0 and isLowerBound = isLB.booleanNot()
|
||||
)
|
||||
or
|
||||
// When `!e` is true, we know that `0 <= e <= 0`
|
||||
exists(float p, float q, Expr e |
|
||||
linearAccess(e, v, p, q) and
|
||||
eqZeroWithNegate(guard, e, true, branch) and
|
||||
boundValue = (0.0 - q) / p and
|
||||
isLowerBound = [false, true] and
|
||||
strictness = Nonstrict()
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1487,6 +1488,15 @@ private predicate isNEPhi(
|
||||
linearAccess(linearExpr, access, p, q) and
|
||||
neConstant = (r - q) / p
|
||||
)
|
||||
or
|
||||
exists(Expr op, boolean branch, Expr linearExpr, float p, float q |
|
||||
access.getTarget() = v and
|
||||
phi.isGuardPhi(access, op, branch) and
|
||||
eqZeroWithNegate(op, linearExpr, false, branch) and
|
||||
v.getUnspecifiedType() instanceof IntegralOrEnumType and // Float `!` is too imprecise
|
||||
linearAccess(linearExpr, access, p, q) and
|
||||
neConstant = (0.0 - q) / p
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1496,10 +1506,13 @@ private predicate isNEPhi(
|
||||
* compile-time constant.
|
||||
*/
|
||||
private predicate isUnsupportedGuardPhi(Variable v, RangeSsaDefinition phi, VariableAccess access) {
|
||||
exists(ComparisonOperation cmp, boolean branch |
|
||||
exists(Expr cmp, boolean branch |
|
||||
eqOpWithSwapAndNegate(cmp, _, _, false, branch)
|
||||
or
|
||||
eqZeroWithNegate(cmp, _, false, branch)
|
||||
|
|
||||
access.getTarget() = v and
|
||||
phi.isGuardPhi(access, cmp, branch) and
|
||||
eqOpWithSwapAndNegate(cmp, _, _, false, branch) and
|
||||
not isNEPhi(v, phi, access, _)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -17,8 +17,8 @@ import semmle.code.cpp.stmts.Stmt
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
class Block extends Stmt, @stmt_block {
|
||||
override string getAPrimaryQlClass() { result = "Block" }
|
||||
class BlockStmt extends Stmt, @stmt_block {
|
||||
override string getAPrimaryQlClass() { result = "BlockStmt" }
|
||||
|
||||
/**
|
||||
* Gets a child declaration of this block.
|
||||
@@ -76,8 +76,8 @@ class Block extends Stmt, @stmt_block {
|
||||
* the result is the expression statement `a = b`.
|
||||
*/
|
||||
Stmt getLastStmtIn() {
|
||||
if getLastStmt() instanceof Block
|
||||
then result = getLastStmt().(Block).getLastStmtIn()
|
||||
if getLastStmt() instanceof BlockStmt
|
||||
then result = getLastStmt().(BlockStmt).getLastStmtIn()
|
||||
else result = getLastStmt()
|
||||
}
|
||||
|
||||
@@ -126,3 +126,9 @@ class Block extends Stmt, @stmt_block {
|
||||
|
||||
override predicate mayBeGloballyImpure() { this.getAStmt().mayBeGloballyImpure() }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: This is now called `BlockStmt` to avoid confusion with
|
||||
* `BasicBlock`.
|
||||
*/
|
||||
deprecated class Block = BlockStmt;
|
||||
|
||||
@@ -25,10 +25,10 @@ class Stmt extends StmtParent, @stmt {
|
||||
/**
|
||||
* Gets the nearest enclosing block of this statement in the source, if any.
|
||||
*/
|
||||
Block getEnclosingBlock() {
|
||||
BlockStmt getEnclosingBlock() {
|
||||
if
|
||||
getParentStmt() instanceof Block and
|
||||
not getParentStmt().(Block).getLocation() instanceof UnknownLocation
|
||||
getParentStmt() instanceof BlockStmt and
|
||||
not getParentStmt().(BlockStmt).getLocation() instanceof UnknownLocation
|
||||
then result = getParentStmt()
|
||||
else result = getParentStmt().getEnclosingBlock()
|
||||
}
|
||||
@@ -53,7 +53,7 @@ class Stmt extends StmtParent, @stmt {
|
||||
* to trace the flow of control instead.
|
||||
*/
|
||||
Stmt getFollowingStmt() {
|
||||
exists(Block b, int i |
|
||||
exists(BlockStmt b, int i |
|
||||
this = b.getStmt(i) and
|
||||
result = b.getStmt(i + 1)
|
||||
)
|
||||
@@ -240,7 +240,7 @@ class IfStmt extends ConditionalStmt, @stmt_if {
|
||||
* ```
|
||||
* if (b) { x = 1; }
|
||||
* ```
|
||||
* the result is the `Block` `{ x = 1; }`.
|
||||
* the result is the `BlockStmt` `{ x = 1; }`.
|
||||
*/
|
||||
Stmt getThen() { if_then(underlyingElement(this), unresolveElement(result)) }
|
||||
|
||||
@@ -251,7 +251,7 @@ class IfStmt extends ConditionalStmt, @stmt_if {
|
||||
* ```
|
||||
* if (b) { x = 1; } else { x = 2; }
|
||||
* ```
|
||||
* the result is the `Block` `{ x = 2; }`, and for
|
||||
* the result is the `BlockStmt` `{ x = 2; }`, and for
|
||||
* ```
|
||||
* if (b) { x = 1; }
|
||||
* ```
|
||||
@@ -326,7 +326,7 @@ class ConstexprIfStmt extends ConditionalStmt, @stmt_constexpr_if {
|
||||
* ```
|
||||
* if constexpr (b) { x = 1; }
|
||||
* ```
|
||||
* the result is the `Block` `{ x = 1; }`.
|
||||
* the result is the `BlockStmt` `{ x = 1; }`.
|
||||
*/
|
||||
Stmt getThen() { constexpr_if_then(underlyingElement(this), unresolveElement(result)) }
|
||||
|
||||
@@ -337,7 +337,7 @@ class ConstexprIfStmt extends ConditionalStmt, @stmt_constexpr_if {
|
||||
* ```
|
||||
* if constexpr (b) { x = 1; } else { x = 2; }
|
||||
* ```
|
||||
* the result is the `Block` `{ x = 2; }`, and for
|
||||
* the result is the `BlockStmt` `{ x = 2; }`, and for
|
||||
* ```
|
||||
* if constexpr (b) { x = 1; }
|
||||
* ```
|
||||
@@ -842,7 +842,7 @@ class RangeBasedForStmt extends Loop, @stmt_range_based_for {
|
||||
* ```
|
||||
* for (int x : xs) { y += x; }
|
||||
* ```
|
||||
* the result is the `Block` `{ y += x; }`.
|
||||
* the result is the `BlockStmt` `{ y += x; }`.
|
||||
*/
|
||||
override Stmt getStmt() { result = this.getChild(5) }
|
||||
|
||||
@@ -1229,7 +1229,7 @@ class SwitchCase extends Stmt, @stmt_switch_case {
|
||||
* DEPRECATED: use `SwitchCase.getAStmt` or `ControlFlowNode.getASuccessor`
|
||||
* rather than this predicate.
|
||||
*
|
||||
* Gets the `Block` statement immediately following this 'switch case'
|
||||
* Gets the `BlockStmt` statement immediately following this 'switch case'
|
||||
* statement, if any.
|
||||
*
|
||||
* For example, for
|
||||
@@ -1250,7 +1250,7 @@ class SwitchCase extends Stmt, @stmt_switch_case {
|
||||
* the `case 7:` has result `{ x = 2; break; }`, `default:` has result
|
||||
* `{ x = 3; }`, and the others have no result.
|
||||
*/
|
||||
deprecated Block getLabelledStmt() {
|
||||
deprecated BlockStmt getLabelledStmt() {
|
||||
exists(int i, Stmt parent |
|
||||
this = parent.getChild(i) and
|
||||
result = parent.getChild(i + 1)
|
||||
@@ -1331,7 +1331,7 @@ class SwitchCase extends Stmt, @stmt_switch_case {
|
||||
* `default:` has results `{ x = 3; }, `x = 4;` and `break;`.
|
||||
*/
|
||||
Stmt getAStmt() {
|
||||
exists(Block b, int i, int j |
|
||||
exists(BlockStmt b, int i, int j |
|
||||
b.getStmt(i) = this and
|
||||
b.getStmt(j) = result and
|
||||
i < j and
|
||||
@@ -1370,8 +1370,8 @@ class SwitchCase extends Stmt, @stmt_switch_case {
|
||||
exists(Stmt lastStmt |
|
||||
lastStmt = this.getAStmt() and
|
||||
not lastStmt.getFollowingStmt() = this.getAStmt() and
|
||||
if lastStmt instanceof Block
|
||||
then result = lastStmt.(Block).getLastStmtIn()
|
||||
if lastStmt instanceof BlockStmt
|
||||
then result = lastStmt.(BlockStmt).getLastStmtIn()
|
||||
else result = lastStmt
|
||||
)
|
||||
}
|
||||
@@ -1528,7 +1528,7 @@ class SwitchStmt extends ConditionalStmt, @stmt_switch {
|
||||
/**
|
||||
* Gets the body statement of this 'switch' statement.
|
||||
*
|
||||
* In almost all cases the result will be a `Block`, but there are
|
||||
* In almost all cases the result will be a `BlockStmt`, but there are
|
||||
* other syntactically valid constructions.
|
||||
*
|
||||
* For example, for
|
||||
@@ -1859,7 +1859,7 @@ class FunctionTryStmt extends TryStmt {
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
class CatchBlock extends Block {
|
||||
class CatchBlock extends BlockStmt {
|
||||
override string getAPrimaryQlClass() { result = "CatchBlock" }
|
||||
|
||||
CatchBlock() { ishandler(underlyingElement(this)) }
|
||||
@@ -1925,7 +1925,7 @@ class MicrosoftTryExceptStmt extends MicrosoftTryStmt {
|
||||
/** Gets the expression guarding the `__except` statement. */
|
||||
Expr getCondition() { result = getChild(1) }
|
||||
|
||||
/** Gets the `__except` statement (usually a `Block`). */
|
||||
/** Gets the `__except` statement (usually a `BlockStmt`). */
|
||||
Stmt getExcept() { result = getChild(2) }
|
||||
|
||||
override string getAPrimaryQlClass() { result = "MicrosoftTryExceptStmt" }
|
||||
@@ -1949,7 +1949,7 @@ class MicrosoftTryFinallyStmt extends MicrosoftTryStmt {
|
||||
|
||||
override string toString() { result = "__try { ... } __finally { ... }" }
|
||||
|
||||
/** Gets the `__finally` statement (usually a `Block`). */
|
||||
/** Gets the `__finally` statement (usually a `BlockStmt`). */
|
||||
Stmt getFinally() { result = getChild(1) }
|
||||
|
||||
override string getAPrimaryQlClass() { result = "MicrosoftTryFinallyStmt" }
|
||||
@@ -2108,7 +2108,7 @@ class VlaDeclStmt extends Stmt, @stmt_vla_decl {
|
||||
* declaration statement.
|
||||
*/
|
||||
int getNumberOfVlaDimensionStmts() {
|
||||
exists(Block b, int j |
|
||||
exists(BlockStmt b, int j |
|
||||
this = b.getStmt(j) and
|
||||
result =
|
||||
j - 1 -
|
||||
@@ -2125,7 +2125,7 @@ class VlaDeclStmt extends Stmt, @stmt_vla_decl {
|
||||
*/
|
||||
VlaDimensionStmt getVlaDimensionStmt(int i) {
|
||||
i in [0 .. this.getNumberOfVlaDimensionStmts() - 1] and
|
||||
exists(Block b, int j |
|
||||
exists(BlockStmt b, int j |
|
||||
this = b.getStmt(j) and
|
||||
result = b.getStmt(j - this.getNumberOfVlaDimensionStmts() + i)
|
||||
)
|
||||
|
||||
@@ -19,7 +19,7 @@ AddressOf.c:
|
||||
# 1| params:
|
||||
# 1| 0: [Parameter] i
|
||||
# 1| Type = [IntType] int
|
||||
# 1| body: [Block] { ... }
|
||||
# 1| body: [BlockStmt] { ... }
|
||||
# 2| 0: [DeclStmt] declaration
|
||||
# 2| 0: [VariableDeclarationEntry] definition of j
|
||||
# 2| Type = [IntPointerType] int *
|
||||
@@ -34,7 +34,7 @@ AddressOf.c:
|
||||
ArrayToPointer.c:
|
||||
# 5| [TopLevelFunction] void ArrayToPointer()
|
||||
# 5| params:
|
||||
# 6| body: [Block] { ... }
|
||||
# 6| body: [BlockStmt] { ... }
|
||||
# 7| 0: [DeclStmt] declaration
|
||||
# 7| 0: [VariableDeclarationEntry] definition of c
|
||||
# 7| Type = [ArrayType] char[]
|
||||
@@ -70,7 +70,7 @@ Cast.c:
|
||||
# 1| Type = [CharPointerType] char *
|
||||
# 1| 1: [Parameter] v
|
||||
# 1| Type = [VoidPointerType] void *
|
||||
# 1| body: [Block] { ... }
|
||||
# 1| body: [BlockStmt] { ... }
|
||||
# 2| 0: [ExprStmt] ExprStmt
|
||||
# 2| 0: [AssignExpr] ... = ...
|
||||
# 2| Type = [CharPointerType] char *
|
||||
@@ -89,7 +89,7 @@ Cast.c:
|
||||
ConditionDecl.cpp:
|
||||
# 1| [TopLevelFunction] void ConditionDecl()
|
||||
# 1| params:
|
||||
# 1| body: [Block] { ... }
|
||||
# 1| body: [BlockStmt] { ... }
|
||||
# 2| 0: [DeclStmt] declaration
|
||||
# 2| 0: [VariableDeclarationEntry] definition of j
|
||||
# 2| Type = [IntType] int
|
||||
@@ -109,7 +109,7 @@ ConditionDecl.cpp:
|
||||
# 3| expr: [VariableAccess] k
|
||||
# 3| Type = [IntType] int
|
||||
# 3| ValueCategory = prvalue(load)
|
||||
# 3| 1: [Block] { ... }
|
||||
# 3| 1: [BlockStmt] { ... }
|
||||
# 5| 2: [ReturnStmt] return ...
|
||||
ConstructorCall.cpp:
|
||||
# 1| [CopyAssignmentOperator] C& C::operator=(C const&)
|
||||
@@ -133,7 +133,7 @@ ConstructorCall.cpp:
|
||||
# 3| 0: [Parameter] i
|
||||
# 3| Type = [IntType] int
|
||||
# 3| initializations:
|
||||
# 3| body: [Block] { ... }
|
||||
# 3| body: [BlockStmt] { ... }
|
||||
# 4| 0: [ReturnStmt] return ...
|
||||
# 7| [CopyAssignmentOperator] D& D::operator=(D const&)
|
||||
# 7| params:
|
||||
@@ -154,7 +154,7 @@ ConstructorCall.cpp:
|
||||
# 9| [Constructor] void D::D()
|
||||
# 9| params:
|
||||
# 9| initializations:
|
||||
# 9| body: [Block] { ... }
|
||||
# 9| body: [BlockStmt] { ... }
|
||||
# 10| 0: [ReturnStmt] return ...
|
||||
# 13| [CopyAssignmentOperator] E& E::operator=(E const&)
|
||||
# 13| params:
|
||||
@@ -172,7 +172,7 @@ ConstructorCall.cpp:
|
||||
# 17| Type = [PointerType] D *
|
||||
# 17| 2: [Parameter] e
|
||||
# 17| Type = [PointerType] E *
|
||||
# 17| body: [Block] { ... }
|
||||
# 17| body: [BlockStmt] { ... }
|
||||
# 18| 0: [ExprStmt] ExprStmt
|
||||
# 18| 0: [AssignExpr] ... = ...
|
||||
# 18| Type = [PointerType] C *
|
||||
@@ -221,7 +221,7 @@ ConstructorCall.cpp:
|
||||
Conversion1.c:
|
||||
# 1| [TopLevelFunction] void Conversion1()
|
||||
# 1| params:
|
||||
# 1| body: [Block] { ... }
|
||||
# 1| body: [BlockStmt] { ... }
|
||||
# 2| 0: [DeclStmt] declaration
|
||||
# 2| 0: [VariableDeclarationEntry] definition of i
|
||||
# 2| Type = [IntType] int
|
||||
@@ -241,7 +241,7 @@ Conversion2.c:
|
||||
# 1| params:
|
||||
# 1| 0: [Parameter] x
|
||||
# 1| Type = [IntType] int
|
||||
# 1| body: [Block] { ... }
|
||||
# 1| body: [BlockStmt] { ... }
|
||||
# 2| 0: [ExprStmt] ExprStmt
|
||||
# 2| 0: [AssignExpr] ... = ...
|
||||
# 2| Type = [IntType] int
|
||||
@@ -277,7 +277,7 @@ Conversion3.cpp:
|
||||
# 1| params:
|
||||
# 1| 0: [Parameter] x
|
||||
# 1| Type = [IntType] int
|
||||
# 1| body: [Block] { ... }
|
||||
# 1| body: [BlockStmt] { ... }
|
||||
# 2| 0: [ExprStmt] ExprStmt
|
||||
# 2| 0: [AssignExpr] ... = ...
|
||||
# 2| Type = [IntType] int
|
||||
@@ -327,7 +327,7 @@ Conversion4.c:
|
||||
# 1| params:
|
||||
# 1| 0: [Parameter] x
|
||||
# 1| Type = [IntType] int
|
||||
# 1| body: [Block] { ... }
|
||||
# 1| body: [BlockStmt] { ... }
|
||||
# 2| 0: [ExprStmt] ExprStmt
|
||||
# 2| 0: [AssignExpr] ... = ...
|
||||
# 2| Type = [IntType] int
|
||||
@@ -352,7 +352,7 @@ Conversion4.c:
|
||||
DestructorCall.cpp:
|
||||
# 3| [Destructor] void C::~C()
|
||||
# 3| params:
|
||||
# 3| body: [Block] { ... }
|
||||
# 3| body: [BlockStmt] { ... }
|
||||
# 4| 0: [ReturnStmt] return ...
|
||||
# 3| destructions:
|
||||
# 11| [TopLevelFunction] void DestructorCall(C*, D*)
|
||||
@@ -361,7 +361,7 @@ DestructorCall.cpp:
|
||||
# 11| Type = [PointerType] C *
|
||||
# 11| 1: [Parameter] d
|
||||
# 11| Type = [PointerType] D *
|
||||
# 11| body: [Block] { ... }
|
||||
# 11| body: [BlockStmt] { ... }
|
||||
# 12| 0: [ExprStmt] ExprStmt
|
||||
# 12| 0: [DeleteExpr] delete
|
||||
# 12| Type = [VoidType] void
|
||||
@@ -385,7 +385,7 @@ DynamicCast.cpp:
|
||||
# 1| params:
|
||||
#-----| 0: [Parameter] p#0
|
||||
#-----| Type = [LValueReferenceType] const Base &
|
||||
#-----| body: [Block] { ... }
|
||||
#-----| body: [BlockStmt] { ... }
|
||||
#-----| 0: [ReturnStmt] return ...
|
||||
#-----| 0: [ReferenceToExpr] (reference to)
|
||||
#-----| Type = [LValueReferenceType] Base &
|
||||
@@ -412,13 +412,13 @@ DynamicCast.cpp:
|
||||
#-----| Type = [RValueReferenceType] Base &&
|
||||
# 2| [VirtualFunction] void Base::f()
|
||||
# 2| params:
|
||||
# 2| body: [Block] { ... }
|
||||
# 2| body: [BlockStmt] { ... }
|
||||
# 2| 0: [ReturnStmt] return ...
|
||||
# 4| [CopyAssignmentOperator] Derived& Derived::operator=(Derived const&)
|
||||
# 4| params:
|
||||
#-----| 0: [Parameter] p#0
|
||||
#-----| Type = [LValueReferenceType] const Derived &
|
||||
#-----| body: [Block] { ... }
|
||||
#-----| body: [BlockStmt] { ... }
|
||||
#-----| 0: [ExprStmt] ExprStmt
|
||||
#-----| 0: [ReferenceDereferenceExpr] (reference dereference)
|
||||
#-----| Type = [Class] Base
|
||||
@@ -478,7 +478,7 @@ DynamicCast.cpp:
|
||||
#-----| Type = [RValueReferenceType] Derived &&
|
||||
# 5| [VirtualFunction] void Derived::f()
|
||||
# 5| params:
|
||||
# 5| body: [Block] { ... }
|
||||
# 5| body: [BlockStmt] { ... }
|
||||
# 5| 0: [ReturnStmt] return ...
|
||||
# 8| [TopLevelFunction] void DynamicCast(Base*, Derived*)
|
||||
# 8| params:
|
||||
@@ -486,7 +486,7 @@ DynamicCast.cpp:
|
||||
# 8| Type = [PointerType] Base *
|
||||
# 8| 1: [Parameter] d
|
||||
# 8| Type = [PointerType] Derived *
|
||||
# 8| body: [Block] { ... }
|
||||
# 8| body: [BlockStmt] { ... }
|
||||
# 9| 0: [ExprStmt] ExprStmt
|
||||
# 9| 0: [AssignExpr] ... = ...
|
||||
# 9| Type = [PointerType] Derived *
|
||||
@@ -508,7 +508,7 @@ DynamicCast.cpp:
|
||||
# 12| Type = [LValueReferenceType] Base &
|
||||
# 12| 1: [Parameter] d
|
||||
# 12| Type = [LValueReferenceType] Derived &
|
||||
# 12| body: [Block] { ... }
|
||||
# 12| body: [BlockStmt] { ... }
|
||||
# 13| 0: [ExprStmt] ExprStmt
|
||||
# 13| 0: [ReferenceDereferenceExpr] (reference dereference)
|
||||
# 13| Type = [Class] Derived
|
||||
@@ -545,7 +545,7 @@ Parenthesis.c:
|
||||
# 1| params:
|
||||
# 1| 0: [Parameter] i
|
||||
# 1| Type = [IntType] int
|
||||
# 1| body: [Block] { ... }
|
||||
# 1| body: [BlockStmt] { ... }
|
||||
# 2| 0: [ExprStmt] ExprStmt
|
||||
# 2| 0: [AssignExpr] ... = ...
|
||||
# 2| Type = [IntType] int
|
||||
@@ -581,7 +581,7 @@ PointerDereference.c:
|
||||
# 1| Type = [IntPointerType] int *
|
||||
# 1| 1: [Parameter] j
|
||||
# 1| Type = [IntType] int
|
||||
# 1| body: [Block] { ... }
|
||||
# 1| body: [BlockStmt] { ... }
|
||||
# 2| 0: [ExprStmt] ExprStmt
|
||||
# 2| 0: [AssignExpr] ... = ...
|
||||
# 2| Type = [IntType] int
|
||||
@@ -603,7 +603,7 @@ ReferenceDereference.cpp:
|
||||
# 4| Type = [LValueReferenceType] int &
|
||||
# 4| 1: [Parameter] j
|
||||
# 4| Type = [IntType] int
|
||||
# 4| body: [Block] { ... }
|
||||
# 4| body: [BlockStmt] { ... }
|
||||
# 5| 0: [ExprStmt] ExprStmt
|
||||
# 5| 0: [AssignExpr] ... = ...
|
||||
# 5| Type = [IntType] int
|
||||
@@ -623,7 +623,7 @@ ReferenceTo.cpp:
|
||||
# 1| params:
|
||||
# 1| 0: [Parameter] i
|
||||
# 1| Type = [IntPointerType] int *
|
||||
# 1| body: [Block] { ... }
|
||||
# 1| body: [BlockStmt] { ... }
|
||||
# 2| 0: [ReturnStmt] return ...
|
||||
# 2| 0: [ReferenceToExpr] (reference to)
|
||||
# 2| Type = [LValueReferenceType] int &
|
||||
@@ -639,7 +639,7 @@ Sizeof.c:
|
||||
# 1| params:
|
||||
# 1| 0: [Parameter] array
|
||||
# 1| Type = [ArrayType] int[]
|
||||
# 1| body: [Block] { ... }
|
||||
# 1| body: [BlockStmt] { ... }
|
||||
# 2| 0: [DeclStmt] declaration
|
||||
# 2| 0: [VariableDeclarationEntry] definition of i
|
||||
# 2| Type = [IntType] int
|
||||
@@ -676,7 +676,7 @@ Sizeof.c:
|
||||
StatementExpr.c:
|
||||
# 1| [TopLevelFunction] void StatementExpr()
|
||||
# 1| params:
|
||||
# 1| body: [Block] { ... }
|
||||
# 1| body: [BlockStmt] { ... }
|
||||
# 2| 0: [DeclStmt] declaration
|
||||
# 2| 0: [VariableDeclarationEntry] definition of j
|
||||
# 2| Type = [IntType] int
|
||||
@@ -700,7 +700,7 @@ StaticMemberAccess.cpp:
|
||||
# 5| Type = [IntType] int
|
||||
# 5| 1: [Parameter] xref
|
||||
# 5| Type = [LValueReferenceType] X &
|
||||
# 5| body: [Block] { ... }
|
||||
# 5| body: [BlockStmt] { ... }
|
||||
# 7| 0: [ExprStmt] ExprStmt
|
||||
# 7| 0: [AssignExpr] ... = ...
|
||||
# 7| Type = [IntType] int
|
||||
@@ -725,7 +725,7 @@ Subscript.c:
|
||||
# 1| Type = [ArrayType] int[]
|
||||
# 1| 1: [Parameter] j
|
||||
# 1| Type = [IntType] int
|
||||
# 1| body: [Block] { ... }
|
||||
# 1| body: [BlockStmt] { ... }
|
||||
# 2| 0: [ExprStmt] ExprStmt
|
||||
# 2| 0: [AssignExpr] ... = ...
|
||||
# 2| Type = [IntType] int
|
||||
@@ -762,20 +762,20 @@ Throw.cpp:
|
||||
#-----| 0: [Parameter] p#0
|
||||
#-----| Type = [RValueReferenceType] F &&
|
||||
# 2| initializations:
|
||||
# 2| body: [Block] { ... }
|
||||
# 2| body: [BlockStmt] { ... }
|
||||
# 2| 0: [ReturnStmt] return ...
|
||||
# 4| [Constructor] void F::F()
|
||||
# 4| params:
|
||||
# 4| initializations:
|
||||
# 4| body: [Block] { ... }
|
||||
# 4| body: [BlockStmt] { ... }
|
||||
# 4| 0: [ReturnStmt] return ...
|
||||
# 6| [TopLevelFunction] void Throw(int)
|
||||
# 6| params:
|
||||
# 6| 0: [Parameter] i
|
||||
# 6| Type = [IntType] int
|
||||
# 6| body: [Block] { ... }
|
||||
# 6| body: [BlockStmt] { ... }
|
||||
# 7| 0: [TryStmt] try { ... }
|
||||
# 7| 0: [Block] { ... }
|
||||
# 7| 0: [BlockStmt] { ... }
|
||||
# 8| 0: [IfStmt] if (...) ...
|
||||
# 8| 0: [CStyleCast] (bool)...
|
||||
# 8| Conversion = [BoolConversion] conversion to bool
|
||||
@@ -818,13 +818,13 @@ Typeid.cpp:
|
||||
# 7| params:
|
||||
# 13| [VirtualFunction] void Base::v()
|
||||
# 13| params:
|
||||
# 13| body: [Block] { ... }
|
||||
# 13| body: [BlockStmt] { ... }
|
||||
# 13| 0: [ReturnStmt] return ...
|
||||
# 18| [TopLevelFunction] void TypeId(Base*)
|
||||
# 18| params:
|
||||
# 18| 0: [Parameter] bp
|
||||
# 18| Type = [PointerType] Base *
|
||||
# 18| body: [Block] { ... }
|
||||
# 18| body: [BlockStmt] { ... }
|
||||
# 19| 0: [DeclStmt] declaration
|
||||
# 19| 0: [VariableDeclarationEntry] definition of name
|
||||
# 19| Type = [PointerType] const char *
|
||||
@@ -846,7 +846,7 @@ VacuousDestructorCall.cpp:
|
||||
# 2| Type = [TemplateParameter] T
|
||||
# 2| 1: [Parameter] y
|
||||
# 2| Type = [PointerType] T *
|
||||
# 2| body: [Block] { ... }
|
||||
# 2| body: [BlockStmt] { ... }
|
||||
# 3| 0: [ExprStmt] ExprStmt
|
||||
# 3| 0: [ExprCall] call to expression
|
||||
# 3| Type = [UnknownType] unknown
|
||||
@@ -874,7 +874,7 @@ VacuousDestructorCall.cpp:
|
||||
# 2| Type = [IntType] int
|
||||
# 2| 1: [Parameter] y
|
||||
# 2| Type = [IntPointerType] int *
|
||||
# 2| body: [Block] { ... }
|
||||
# 2| body: [BlockStmt] { ... }
|
||||
# 3| 0: [ExprStmt] ExprStmt
|
||||
# 3| 0: [VacuousDestructorCall] (vacuous destructor call)
|
||||
# 3| Type = [VoidType] void
|
||||
@@ -894,7 +894,7 @@ VacuousDestructorCall.cpp:
|
||||
# 7| params:
|
||||
# 7| 0: [Parameter] i
|
||||
# 7| Type = [IntType] int
|
||||
# 7| body: [Block] { ... }
|
||||
# 7| body: [BlockStmt] { ... }
|
||||
# 10| 0: [ExprStmt] ExprStmt
|
||||
# 10| 0: [FunctionCall] call to CallDestructor
|
||||
# 10| Type = [VoidType] void
|
||||
@@ -914,7 +914,7 @@ Varargs.c:
|
||||
# 8| params:
|
||||
# 8| 0: [Parameter] text
|
||||
# 8| Type = [PointerType] const char *
|
||||
# 8| body: [Block] { ... }
|
||||
# 8| body: [BlockStmt] { ... }
|
||||
# 9| 0: [DeclStmt] declaration
|
||||
# 9| 0: [VariableDeclarationEntry] definition of args
|
||||
# 9| Type = [CTypedefType] va_list
|
||||
@@ -947,7 +947,7 @@ macro_etc.c:
|
||||
# 3| params:
|
||||
# 3| 0: [Parameter] i
|
||||
# 3| Type = [IntType] int
|
||||
# 3| body: [Block] { ... }
|
||||
# 3| body: [BlockStmt] { ... }
|
||||
# 4| 0: [DeclStmt] declaration
|
||||
# 4| 0: [TypeDeclarationEntry] definition of u
|
||||
# 4| Type = [LocalUnion] u
|
||||
@@ -997,7 +997,7 @@ macro_etc.c:
|
||||
# 10| ValueCategory = prvalue
|
||||
# 22| [TopLevelFunction] int foo()
|
||||
# 22| params:
|
||||
# 22| body: [Block] { ... }
|
||||
# 22| body: [BlockStmt] { ... }
|
||||
# 23| 0: [DeclStmt] declaration
|
||||
# 23| 0: [VariableDeclarationEntry] definition of t
|
||||
# 23| Type = [IntType] int
|
||||
@@ -1059,7 +1059,7 @@ macro_etc.c:
|
||||
# 27| 0: [VariableAccess] i
|
||||
# 27| Type = [PlainCharType] char
|
||||
# 27| ValueCategory = lvalue
|
||||
# 27| 3: [Block] { ... }
|
||||
# 27| 3: [BlockStmt] { ... }
|
||||
# 27| 0: [ExprStmt] ExprStmt
|
||||
# 27| 0: [AssignAddExpr] ... += ...
|
||||
# 27| Type = [IntType] int
|
||||
@@ -1111,7 +1111,7 @@ macro_etc.c:
|
||||
# 28| 0: [VariableAccess] i
|
||||
# 28| Type = [PlainCharType] char
|
||||
# 28| ValueCategory = lvalue
|
||||
# 28| 3: [Block] { ... }
|
||||
# 28| 3: [BlockStmt] { ... }
|
||||
# 28| 0: [ExprStmt] ExprStmt
|
||||
# 28| 0: [AssignAddExpr] ... += ...
|
||||
# 28| Type = [IntType] int
|
||||
@@ -1210,7 +1210,7 @@ union_etc.cpp:
|
||||
# 2| [Constructor] void S::S()
|
||||
# 2| params:
|
||||
# 2| initializations:
|
||||
# 2| body: [Block] { ... }
|
||||
# 2| body: [BlockStmt] { ... }
|
||||
# 2| 0: [ReturnStmt] return ...
|
||||
# 2| [CopyConstructor] void S::S(S const&)
|
||||
# 2| params:
|
||||
@@ -1240,7 +1240,7 @@ union_etc.cpp:
|
||||
# 6| params:
|
||||
# 6| 0: [Parameter] val
|
||||
# 6| Type = [IntType] int
|
||||
# 6| body: [Block] { ... }
|
||||
# 6| body: [BlockStmt] { ... }
|
||||
# 6| 0: [ExprStmt] ExprStmt
|
||||
# 6| 0: [AssignExpr] ... = ...
|
||||
# 6| Type = [IntType] int
|
||||
@@ -1305,7 +1305,7 @@ union_etc.cpp:
|
||||
#-----| Type = [RValueReferenceType] C &&
|
||||
# 22| [TopLevelFunction] int foo()
|
||||
# 22| params:
|
||||
# 22| body: [Block] { ... }
|
||||
# 22| body: [BlockStmt] { ... }
|
||||
# 23| 0: [DeclStmt] declaration
|
||||
# 23| 0: [VariableDeclarationEntry] definition of s
|
||||
# 23| Type = [Struct] S
|
||||
@@ -1423,7 +1423,7 @@ union_etc.cpp:
|
||||
# 33| params:
|
||||
# 33| 0: [Parameter] val
|
||||
# 33| Type = [IntType] int
|
||||
# 33| body: [Block] { ... }
|
||||
# 33| body: [BlockStmt] { ... }
|
||||
# 33| 0: [ExprStmt] ExprStmt
|
||||
# 33| 0: [AssignExpr] ... = ...
|
||||
# 33| Type = [IntType] int
|
||||
@@ -1440,7 +1440,7 @@ union_etc.cpp:
|
||||
# 33| 1: [ReturnStmt] return ...
|
||||
# 36| [TopLevelFunction] int bar()
|
||||
# 36| params:
|
||||
# 36| body: [Block] { ... }
|
||||
# 36| body: [BlockStmt] { ... }
|
||||
# 37| 0: [DeclStmt] declaration
|
||||
# 37| 0: [VariableDeclarationEntry] definition of s
|
||||
# 37| Type = [PointerType] const T *
|
||||
|
||||
@@ -88,14 +88,14 @@ void test_stringstream()
|
||||
ss5 << t;
|
||||
|
||||
sink(ss1);
|
||||
sink(ss2); // tainted [NOT DETECTED]
|
||||
sink(ss2); // tainted
|
||||
sink(ss3); // tainted [NOT DETECTED]
|
||||
sink(ss4); // tainted [NOT DETECTED]
|
||||
sink(ss4); // tainted
|
||||
sink(ss5); // tainted [NOT DETECTED]
|
||||
sink(ss1.str());
|
||||
sink(ss2.str()); // tainted [NOT DETECTED]
|
||||
sink(ss2.str()); // tainted
|
||||
sink(ss3.str()); // tainted [NOT DETECTED]
|
||||
sink(ss4.str()); // tainted [NOT DETECTED]
|
||||
sink(ss4.str()); // tainted
|
||||
sink(ss5.str()); // tainted [NOT DETECTED]
|
||||
}
|
||||
|
||||
|
||||
@@ -173,8 +173,10 @@
|
||||
| globals.cpp:23:15:23:20 | call to getenv | globals.cpp:23:15:23:20 | call to getenv |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | shared.h:5:23:5:31 | sinkparam |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:21:29:21:29 | s |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:43:78:43:104 | p#0 |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:43:114:43:118 | p#1 |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:62:25:62:30 | call to getenv |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:64:36:64:36 | s |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:68:8:68:8 | a |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:68:12:68:17 | call to source |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:70:16:70:21 | call to source |
|
||||
@@ -185,12 +187,31 @@
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:82:16:82:21 | call to source |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:82:16:82:23 | (const char *)... |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:82:16:82:24 | call to basic_string |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:85:6:85:6 | call to operator<< |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:85:6:85:17 | (reference dereference) |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:85:9:85:14 | call to source |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:85:9:85:16 | (const char *)... |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:86:15:86:15 | call to operator<< |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:86:15:86:26 | (reference dereference) |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:86:18:86:23 | call to source |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:86:18:86:25 | (const char *)... |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:87:6:87:6 | call to operator<< |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:87:6:87:19 | (reference dereference) |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:87:6:87:19 | (reference to) |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:87:9:87:14 | call to source |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:87:9:87:16 | (const char *)... |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:87:18:87:18 | call to operator<< |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:87:18:87:26 | (reference dereference) |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:91:7:91:9 | (const stringstream)... |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:91:7:91:9 | (reference to) |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:91:7:91:9 | ss2 |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:93:7:93:9 | (const stringstream)... |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:93:7:93:9 | (reference to) |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:93:7:93:9 | ss4 |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:96:7:96:9 | (const basic_stringstream<char, char_traits<char>, allocator<char>>)... |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:96:7:96:9 | ss2 |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:98:7:98:9 | (const basic_stringstream<char, char_traits<char>, allocator<char>>)... |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:98:7:98:9 | ss4 |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:118:10:118:15 | call to source |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:125:16:125:28 | call to basic_string |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:125:17:125:26 | call to user_input |
|
||||
|
||||
@@ -37,10 +37,31 @@
|
||||
| defaulttainttracking.cpp:208:27:208:32 | call to getenv | defaulttainttracking.cpp:208:23:208:23 | x | AST only |
|
||||
| globals.cpp:13:15:13:20 | call to getenv | globals.cpp:13:5:13:11 | global1 | AST only |
|
||||
| globals.cpp:23:15:23:20 | call to getenv | globals.cpp:23:5:23:11 | global2 | AST only |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:43:78:43:104 | p#0 | IR only |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:62:7:62:12 | source | AST only |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:64:36:64:36 | s | IR only |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:70:16:70:24 | call to basic_string | IR only |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:82:16:82:24 | call to basic_string | IR only |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:85:6:85:6 | call to operator<< | IR only |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:85:6:85:17 | (reference dereference) | IR only |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:86:15:86:15 | call to operator<< | IR only |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:86:15:86:26 | (reference dereference) | IR only |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:87:6:87:6 | call to operator<< | IR only |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:87:6:87:19 | (reference dereference) | IR only |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:87:6:87:19 | (reference to) | IR only |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:87:9:87:16 | (const char *)... | IR only |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:87:18:87:18 | call to operator<< | IR only |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:87:18:87:26 | (reference dereference) | IR only |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:91:7:91:9 | (const stringstream)... | IR only |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:91:7:91:9 | (reference to) | IR only |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:91:7:91:9 | ss2 | IR only |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:93:7:93:9 | (const stringstream)... | IR only |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:93:7:93:9 | (reference to) | IR only |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:93:7:93:9 | ss4 | IR only |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:96:7:96:9 | (const basic_stringstream<char, char_traits<char>, allocator<char>>)... | IR only |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:96:7:96:9 | ss2 | IR only |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:98:7:98:9 | (const basic_stringstream<char, char_traits<char>, allocator<char>>)... | IR only |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:98:7:98:9 | ss4 | IR only |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:117:7:117:16 | user_input | AST only |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:125:16:125:28 | call to basic_string | IR only |
|
||||
| stl.cpp:62:25:62:30 | call to getenv | stl.cpp:128:9:128:13 | path2 | IR only |
|
||||
|
||||
@@ -439,6 +439,46 @@
|
||||
| movableclass.cpp:65:13:65:18 | call to source | movableclass.cpp:65:13:65:20 | call to MyMovableClass | TAINT |
|
||||
| movableclass.cpp:65:13:65:20 | call to MyMovableClass | movableclass.cpp:65:8:65:9 | ref arg s3 | TAINT |
|
||||
| movableclass.cpp:65:13:65:20 | call to MyMovableClass | movableclass.cpp:65:11:65:11 | call to operator= | TAINT |
|
||||
| smart_pointer.cpp:11:30:11:50 | call to make_shared | smart_pointer.cpp:12:11:12:11 | p | |
|
||||
| smart_pointer.cpp:11:30:11:50 | call to make_shared | smart_pointer.cpp:13:10:13:10 | p | |
|
||||
| smart_pointer.cpp:11:52:11:57 | call to source | smart_pointer.cpp:11:30:11:50 | call to make_shared | TAINT |
|
||||
| smart_pointer.cpp:12:11:12:11 | p | smart_pointer.cpp:12:10:12:10 | call to operator* | TAINT |
|
||||
| smart_pointer.cpp:17:32:17:54 | call to make_shared | smart_pointer.cpp:18:11:18:11 | p | |
|
||||
| smart_pointer.cpp:17:32:17:54 | call to make_shared | smart_pointer.cpp:19:10:19:10 | p | |
|
||||
| smart_pointer.cpp:18:11:18:11 | p | smart_pointer.cpp:18:10:18:10 | call to operator* | TAINT |
|
||||
| smart_pointer.cpp:23:30:23:50 | call to make_unique | smart_pointer.cpp:24:11:24:11 | p | |
|
||||
| smart_pointer.cpp:23:30:23:50 | call to make_unique | smart_pointer.cpp:25:10:25:10 | p | |
|
||||
| smart_pointer.cpp:23:52:23:57 | call to source | smart_pointer.cpp:23:30:23:50 | call to make_unique | TAINT |
|
||||
| smart_pointer.cpp:24:11:24:11 | p | smart_pointer.cpp:24:10:24:10 | call to operator* | TAINT |
|
||||
| smart_pointer.cpp:29:32:29:54 | call to make_unique | smart_pointer.cpp:30:11:30:11 | p | |
|
||||
| smart_pointer.cpp:29:32:29:54 | call to make_unique | smart_pointer.cpp:31:10:31:10 | p | |
|
||||
| smart_pointer.cpp:30:11:30:11 | p | smart_pointer.cpp:30:10:30:10 | call to operator* | TAINT |
|
||||
| smart_pointer.cpp:35:30:35:50 | call to make_shared | smart_pointer.cpp:37:6:37:6 | p | |
|
||||
| smart_pointer.cpp:35:30:35:50 | call to make_shared | smart_pointer.cpp:38:10:38:10 | p | |
|
||||
| smart_pointer.cpp:35:30:35:50 | call to make_shared | smart_pointer.cpp:39:11:39:11 | p | |
|
||||
| smart_pointer.cpp:37:5:37:17 | ... = ... | smart_pointer.cpp:37:5:37:5 | call to operator* [post update] | |
|
||||
| smart_pointer.cpp:37:6:37:6 | p | smart_pointer.cpp:37:5:37:5 | call to operator* | TAINT |
|
||||
| smart_pointer.cpp:37:10:37:15 | call to source | smart_pointer.cpp:37:5:37:17 | ... = ... | |
|
||||
| smart_pointer.cpp:38:10:38:10 | ref arg p | smart_pointer.cpp:39:11:39:11 | p | |
|
||||
| smart_pointer.cpp:39:11:39:11 | p | smart_pointer.cpp:39:10:39:10 | call to operator* | TAINT |
|
||||
| smart_pointer.cpp:43:29:43:51 | call to unique_ptr | smart_pointer.cpp:45:6:45:6 | p | |
|
||||
| smart_pointer.cpp:43:29:43:51 | call to unique_ptr | smart_pointer.cpp:46:10:46:10 | p | |
|
||||
| smart_pointer.cpp:43:29:43:51 | call to unique_ptr | smart_pointer.cpp:47:11:47:11 | p | |
|
||||
| smart_pointer.cpp:45:5:45:17 | ... = ... | smart_pointer.cpp:45:5:45:5 | call to operator* [post update] | |
|
||||
| smart_pointer.cpp:45:6:45:6 | p | smart_pointer.cpp:45:5:45:5 | call to operator* | TAINT |
|
||||
| smart_pointer.cpp:45:10:45:15 | call to source | smart_pointer.cpp:45:5:45:17 | ... = ... | |
|
||||
| smart_pointer.cpp:46:10:46:10 | ref arg p | smart_pointer.cpp:47:11:47:11 | p | |
|
||||
| smart_pointer.cpp:47:11:47:11 | p | smart_pointer.cpp:47:10:47:10 | call to operator* | TAINT |
|
||||
| smart_pointer.cpp:51:30:51:50 | call to make_shared | smart_pointer.cpp:52:10:52:10 | p | |
|
||||
| smart_pointer.cpp:51:52:51:57 | call to source | smart_pointer.cpp:51:30:51:50 | call to make_shared | TAINT |
|
||||
| smart_pointer.cpp:52:10:52:10 | p | smart_pointer.cpp:52:12:52:14 | call to get | TAINT |
|
||||
| smart_pointer.cpp:56:30:56:50 | call to make_unique | smart_pointer.cpp:57:10:57:10 | p | |
|
||||
| smart_pointer.cpp:56:52:56:57 | call to source | smart_pointer.cpp:56:30:56:50 | call to make_unique | TAINT |
|
||||
| smart_pointer.cpp:57:10:57:10 | p | smart_pointer.cpp:57:12:57:14 | call to get | TAINT |
|
||||
| smart_pointer.cpp:65:28:65:46 | call to make_unique | smart_pointer.cpp:66:10:66:10 | p | |
|
||||
| smart_pointer.cpp:65:28:65:46 | call to make_unique | smart_pointer.cpp:67:10:67:10 | p | |
|
||||
| smart_pointer.cpp:65:48:65:53 | call to source | smart_pointer.cpp:65:28:65:46 | call to make_unique | TAINT |
|
||||
| smart_pointer.cpp:65:58:65:58 | 0 | smart_pointer.cpp:65:28:65:46 | call to make_unique | TAINT |
|
||||
| standalone_iterators.cpp:39:45:39:51 | source1 | standalone_iterators.cpp:40:11:40:17 | source1 | |
|
||||
| standalone_iterators.cpp:39:45:39:51 | source1 | standalone_iterators.cpp:41:12:41:18 | source1 | |
|
||||
| standalone_iterators.cpp:39:45:39:51 | source1 | standalone_iterators.cpp:42:14:42:20 | source1 | |
|
||||
@@ -461,12 +501,12 @@
|
||||
| standalone_iterators.cpp:51:37:51:43 | source1 | standalone_iterators.cpp:53:12:53:18 | source1 | |
|
||||
| standalone_iterators.cpp:51:37:51:43 | source1 | standalone_iterators.cpp:54:14:54:20 | source1 | |
|
||||
| standalone_iterators.cpp:53:12:53:18 | ref arg source1 | standalone_iterators.cpp:54:14:54:20 | source1 | |
|
||||
| stl.h:179:30:179:40 | call to allocator | stl.h:179:21:179:41 | noexcept(...) | TAINT |
|
||||
| stl.h:179:30:179:40 | call to allocator | stl.h:179:21:179:41 | noexcept(...) | TAINT |
|
||||
| stl.h:179:30:179:40 | call to allocator | stl.h:179:21:179:41 | noexcept(...) | TAINT |
|
||||
| stl.h:179:30:179:40 | call to allocator | stl.h:179:21:179:41 | noexcept(...) | TAINT |
|
||||
| stl.h:179:30:179:40 | call to allocator | stl.h:179:21:179:41 | noexcept(...) | TAINT |
|
||||
| stl.h:179:53:179:63 | 0 | stl.h:179:46:179:64 | (no string representation) | TAINT |
|
||||
| stl.h:204:30:204:40 | call to allocator | stl.h:204:21:204:41 | noexcept(...) | TAINT |
|
||||
| stl.h:204:30:204:40 | call to allocator | stl.h:204:21:204:41 | noexcept(...) | TAINT |
|
||||
| stl.h:204:30:204:40 | call to allocator | stl.h:204:21:204:41 | noexcept(...) | TAINT |
|
||||
| stl.h:204:30:204:40 | call to allocator | stl.h:204:21:204:41 | noexcept(...) | TAINT |
|
||||
| stl.h:204:30:204:40 | call to allocator | stl.h:204:21:204:41 | noexcept(...) | TAINT |
|
||||
| stl.h:204:53:204:63 | 0 | stl.h:204:46:204:64 | (no string representation) | TAINT |
|
||||
| string.cpp:24:12:24:17 | call to source | string.cpp:28:7:28:7 | a | |
|
||||
| string.cpp:25:16:25:20 | 123 | string.cpp:25:16:25:21 | call to basic_string | TAINT |
|
||||
| string.cpp:25:16:25:21 | call to basic_string | string.cpp:29:7:29:7 | b | |
|
||||
@@ -1356,44 +1396,372 @@
|
||||
| string.cpp:551:35:551:38 | call to basic_string | string.cpp:551:11:551:16 | ref arg call to assign | TAINT |
|
||||
| string.cpp:551:35:551:38 | call to basic_string | string.cpp:551:28:551:33 | call to assign | TAINT |
|
||||
| string.cpp:551:35:551:38 | ff | string.cpp:551:35:551:38 | call to basic_string | TAINT |
|
||||
| stringstream.cpp:13:20:13:22 | call to basic_stringstream | stringstream.cpp:16:2:16:4 | ss1 | |
|
||||
| stringstream.cpp:13:20:13:22 | call to basic_stringstream | stringstream.cpp:22:7:22:9 | ss1 | |
|
||||
| stringstream.cpp:13:20:13:22 | call to basic_stringstream | stringstream.cpp:27:7:27:9 | ss1 | |
|
||||
| stringstream.cpp:13:25:13:27 | call to basic_stringstream | stringstream.cpp:17:2:17:4 | ss2 | |
|
||||
| stringstream.cpp:13:25:13:27 | call to basic_stringstream | stringstream.cpp:23:7:23:9 | ss2 | |
|
||||
| stringstream.cpp:13:25:13:27 | call to basic_stringstream | stringstream.cpp:28:7:28:9 | ss2 | |
|
||||
| stringstream.cpp:13:30:13:32 | call to basic_stringstream | stringstream.cpp:18:2:18:4 | ss3 | |
|
||||
| stringstream.cpp:13:30:13:32 | call to basic_stringstream | stringstream.cpp:24:7:24:9 | ss3 | |
|
||||
| stringstream.cpp:13:30:13:32 | call to basic_stringstream | stringstream.cpp:29:7:29:9 | ss3 | |
|
||||
| stringstream.cpp:13:35:13:37 | call to basic_stringstream | stringstream.cpp:19:2:19:4 | ss4 | |
|
||||
| stringstream.cpp:13:35:13:37 | call to basic_stringstream | stringstream.cpp:25:7:25:9 | ss4 | |
|
||||
| stringstream.cpp:13:35:13:37 | call to basic_stringstream | stringstream.cpp:30:7:30:9 | ss4 | |
|
||||
| stringstream.cpp:13:40:13:42 | call to basic_stringstream | stringstream.cpp:20:2:20:4 | ss5 | |
|
||||
| stringstream.cpp:13:40:13:42 | call to basic_stringstream | stringstream.cpp:26:7:26:9 | ss5 | |
|
||||
| stringstream.cpp:13:40:13:42 | call to basic_stringstream | stringstream.cpp:31:7:31:9 | ss5 | |
|
||||
| stringstream.cpp:14:16:14:21 | call to source | stringstream.cpp:14:16:14:24 | call to basic_string | TAINT |
|
||||
| stringstream.cpp:14:16:14:24 | call to basic_string | stringstream.cpp:20:9:20:9 | t | |
|
||||
| stringstream.cpp:16:2:16:4 | ref arg ss1 | stringstream.cpp:22:7:22:9 | ss1 | |
|
||||
| stringstream.cpp:16:2:16:4 | ref arg ss1 | stringstream.cpp:27:7:27:9 | ss1 | |
|
||||
| stringstream.cpp:17:2:17:4 | ref arg ss2 | stringstream.cpp:23:7:23:9 | ss2 | |
|
||||
| stringstream.cpp:17:2:17:4 | ref arg ss2 | stringstream.cpp:28:7:28:9 | ss2 | |
|
||||
| stringstream.cpp:18:2:18:4 | ref arg ss3 | stringstream.cpp:24:7:24:9 | ss3 | |
|
||||
| stringstream.cpp:18:2:18:4 | ref arg ss3 | stringstream.cpp:29:7:29:9 | ss3 | |
|
||||
| stringstream.cpp:19:2:19:4 | ref arg ss4 | stringstream.cpp:25:7:25:9 | ss4 | |
|
||||
| stringstream.cpp:19:2:19:4 | ref arg ss4 | stringstream.cpp:30:7:30:9 | ss4 | |
|
||||
| stringstream.cpp:20:2:20:4 | ref arg ss5 | stringstream.cpp:26:7:26:9 | ss5 | |
|
||||
| stringstream.cpp:20:2:20:4 | ref arg ss5 | stringstream.cpp:31:7:31:9 | ss5 | |
|
||||
| stringstream.cpp:34:32:34:37 | source | stringstream.cpp:39:9:39:14 | source | |
|
||||
| stringstream.cpp:36:20:36:22 | call to basic_stringstream | stringstream.cpp:38:2:38:4 | ss1 | |
|
||||
| stringstream.cpp:36:20:36:22 | call to basic_stringstream | stringstream.cpp:41:7:41:9 | ss1 | |
|
||||
| stringstream.cpp:36:20:36:22 | call to basic_stringstream | stringstream.cpp:43:7:43:9 | ss1 | |
|
||||
| stringstream.cpp:36:25:36:27 | call to basic_stringstream | stringstream.cpp:39:2:39:4 | ss2 | |
|
||||
| stringstream.cpp:36:25:36:27 | call to basic_stringstream | stringstream.cpp:42:7:42:9 | ss2 | |
|
||||
| stringstream.cpp:36:25:36:27 | call to basic_stringstream | stringstream.cpp:44:7:44:9 | ss2 | |
|
||||
| stringstream.cpp:38:2:38:4 | ref arg ss1 | stringstream.cpp:41:7:41:9 | ss1 | |
|
||||
| stringstream.cpp:38:2:38:4 | ref arg ss1 | stringstream.cpp:43:7:43:9 | ss1 | |
|
||||
| stringstream.cpp:39:2:39:4 | ref arg ss2 | stringstream.cpp:42:7:42:9 | ss2 | |
|
||||
| stringstream.cpp:39:2:39:4 | ref arg ss2 | stringstream.cpp:44:7:44:9 | ss2 | |
|
||||
| stringstream.cpp:26:35:26:40 | amount | stringstream.cpp:64:46:64:51 | amount | |
|
||||
| stringstream.cpp:28:20:28:22 | call to basic_stringstream | stringstream.cpp:31:7:31:9 | ss1 | |
|
||||
| stringstream.cpp:28:20:28:22 | call to basic_stringstream | stringstream.cpp:37:7:37:9 | ss1 | |
|
||||
| stringstream.cpp:28:20:28:22 | call to basic_stringstream | stringstream.cpp:42:7:42:9 | ss1 | |
|
||||
| stringstream.cpp:28:25:28:27 | call to basic_stringstream | stringstream.cpp:32:7:32:9 | ss2 | |
|
||||
| stringstream.cpp:28:25:28:27 | call to basic_stringstream | stringstream.cpp:38:7:38:9 | ss2 | |
|
||||
| stringstream.cpp:28:25:28:27 | call to basic_stringstream | stringstream.cpp:43:7:43:9 | ss2 | |
|
||||
| stringstream.cpp:28:30:28:32 | call to basic_stringstream | stringstream.cpp:33:7:33:9 | ss3 | |
|
||||
| stringstream.cpp:28:30:28:32 | call to basic_stringstream | stringstream.cpp:39:7:39:9 | ss3 | |
|
||||
| stringstream.cpp:28:30:28:32 | call to basic_stringstream | stringstream.cpp:44:7:44:9 | ss3 | |
|
||||
| stringstream.cpp:28:35:28:37 | call to basic_stringstream | stringstream.cpp:34:7:34:9 | ss4 | |
|
||||
| stringstream.cpp:28:35:28:37 | call to basic_stringstream | stringstream.cpp:40:7:40:9 | ss4 | |
|
||||
| stringstream.cpp:28:35:28:37 | call to basic_stringstream | stringstream.cpp:45:7:45:9 | ss4 | |
|
||||
| stringstream.cpp:28:40:28:42 | call to basic_stringstream | stringstream.cpp:35:7:35:9 | ss5 | |
|
||||
| stringstream.cpp:28:40:28:42 | call to basic_stringstream | stringstream.cpp:41:7:41:9 | ss5 | |
|
||||
| stringstream.cpp:28:40:28:42 | call to basic_stringstream | stringstream.cpp:46:7:46:9 | ss5 | |
|
||||
| stringstream.cpp:28:45:28:47 | call to basic_stringstream | stringstream.cpp:48:2:48:4 | ss6 | |
|
||||
| stringstream.cpp:28:45:28:47 | call to basic_stringstream | stringstream.cpp:49:2:49:4 | ss6 | |
|
||||
| stringstream.cpp:28:45:28:47 | call to basic_stringstream | stringstream.cpp:52:7:52:9 | ss6 | |
|
||||
| stringstream.cpp:28:50:28:52 | call to basic_stringstream | stringstream.cpp:50:2:50:4 | ss7 | |
|
||||
| stringstream.cpp:28:50:28:52 | call to basic_stringstream | stringstream.cpp:51:2:51:4 | ss7 | |
|
||||
| stringstream.cpp:28:50:28:52 | call to basic_stringstream | stringstream.cpp:53:7:53:9 | ss7 | |
|
||||
| stringstream.cpp:28:55:28:57 | call to basic_stringstream | stringstream.cpp:55:7:55:9 | ss8 | |
|
||||
| stringstream.cpp:28:55:28:57 | call to basic_stringstream | stringstream.cpp:58:7:58:9 | ss8 | |
|
||||
| stringstream.cpp:28:60:28:62 | call to basic_stringstream | stringstream.cpp:56:7:56:9 | ss9 | |
|
||||
| stringstream.cpp:28:60:28:62 | call to basic_stringstream | stringstream.cpp:59:7:59:9 | ss9 | |
|
||||
| stringstream.cpp:28:65:28:68 | call to basic_stringstream | stringstream.cpp:57:7:57:10 | ss10 | |
|
||||
| stringstream.cpp:28:65:28:68 | call to basic_stringstream | stringstream.cpp:60:7:60:10 | ss10 | |
|
||||
| stringstream.cpp:28:71:28:74 | call to basic_stringstream | stringstream.cpp:62:7:62:10 | ss11 | |
|
||||
| stringstream.cpp:28:71:28:74 | call to basic_stringstream | stringstream.cpp:65:7:65:10 | ss11 | |
|
||||
| stringstream.cpp:28:77:28:80 | call to basic_stringstream | stringstream.cpp:63:7:63:10 | ss12 | |
|
||||
| stringstream.cpp:28:77:28:80 | call to basic_stringstream | stringstream.cpp:66:7:66:10 | ss12 | |
|
||||
| stringstream.cpp:28:83:28:86 | call to basic_stringstream | stringstream.cpp:64:7:64:10 | ss13 | |
|
||||
| stringstream.cpp:28:83:28:86 | call to basic_stringstream | stringstream.cpp:67:7:67:10 | ss13 | |
|
||||
| stringstream.cpp:29:16:29:21 | call to source | stringstream.cpp:29:16:29:24 | call to basic_string | TAINT |
|
||||
| stringstream.cpp:29:16:29:24 | call to basic_string | stringstream.cpp:35:14:35:14 | t | |
|
||||
| stringstream.cpp:31:7:31:9 | ref arg ss1 | stringstream.cpp:37:7:37:9 | ss1 | |
|
||||
| stringstream.cpp:31:7:31:9 | ref arg ss1 | stringstream.cpp:42:7:42:9 | ss1 | |
|
||||
| stringstream.cpp:31:7:31:9 | ss1 | stringstream.cpp:31:11:31:11 | call to operator<< | |
|
||||
| stringstream.cpp:31:14:31:19 | 1234 | stringstream.cpp:31:7:31:9 | ref arg ss1 | TAINT |
|
||||
| stringstream.cpp:31:14:31:19 | 1234 | stringstream.cpp:31:11:31:11 | call to operator<< | TAINT |
|
||||
| stringstream.cpp:32:7:32:9 | ref arg ss2 | stringstream.cpp:38:7:38:9 | ss2 | |
|
||||
| stringstream.cpp:32:7:32:9 | ref arg ss2 | stringstream.cpp:43:7:43:9 | ss2 | |
|
||||
| stringstream.cpp:32:7:32:9 | ss2 | stringstream.cpp:32:11:32:11 | call to operator<< | |
|
||||
| stringstream.cpp:32:14:32:19 | call to source | stringstream.cpp:32:7:32:9 | ref arg ss2 | TAINT |
|
||||
| stringstream.cpp:32:14:32:19 | call to source | stringstream.cpp:32:11:32:11 | call to operator<< | TAINT |
|
||||
| stringstream.cpp:33:7:33:9 | ref arg ss3 | stringstream.cpp:39:7:39:9 | ss3 | |
|
||||
| stringstream.cpp:33:7:33:9 | ref arg ss3 | stringstream.cpp:44:7:44:9 | ss3 | |
|
||||
| stringstream.cpp:33:7:33:9 | ss3 | stringstream.cpp:33:11:33:11 | call to operator<< | |
|
||||
| stringstream.cpp:33:11:33:11 | call to operator<< | stringstream.cpp:33:20:33:20 | call to operator<< | |
|
||||
| stringstream.cpp:33:11:33:11 | ref arg call to operator<< | stringstream.cpp:33:7:33:9 | ref arg ss3 | TAINT |
|
||||
| stringstream.cpp:33:14:33:18 | 123 | stringstream.cpp:33:7:33:9 | ref arg ss3 | TAINT |
|
||||
| stringstream.cpp:33:14:33:18 | 123 | stringstream.cpp:33:11:33:11 | call to operator<< | TAINT |
|
||||
| stringstream.cpp:33:23:33:28 | call to source | stringstream.cpp:33:11:33:11 | ref arg call to operator<< | TAINT |
|
||||
| stringstream.cpp:33:23:33:28 | call to source | stringstream.cpp:33:20:33:20 | call to operator<< | TAINT |
|
||||
| stringstream.cpp:34:7:34:9 | ref arg ss4 | stringstream.cpp:40:7:40:9 | ss4 | |
|
||||
| stringstream.cpp:34:7:34:9 | ref arg ss4 | stringstream.cpp:45:7:45:9 | ss4 | |
|
||||
| stringstream.cpp:34:7:34:9 | ss4 | stringstream.cpp:34:11:34:11 | call to operator<< | |
|
||||
| stringstream.cpp:34:11:34:11 | call to operator<< | stringstream.cpp:34:23:34:23 | call to operator<< | |
|
||||
| stringstream.cpp:34:11:34:11 | ref arg call to operator<< | stringstream.cpp:34:7:34:9 | ref arg ss4 | TAINT |
|
||||
| stringstream.cpp:34:14:34:19 | call to source | stringstream.cpp:34:7:34:9 | ref arg ss4 | TAINT |
|
||||
| stringstream.cpp:34:14:34:19 | call to source | stringstream.cpp:34:11:34:11 | call to operator<< | TAINT |
|
||||
| stringstream.cpp:34:26:34:30 | 456 | stringstream.cpp:34:11:34:11 | ref arg call to operator<< | TAINT |
|
||||
| stringstream.cpp:34:26:34:30 | 456 | stringstream.cpp:34:23:34:23 | call to operator<< | TAINT |
|
||||
| stringstream.cpp:35:7:35:9 | ref arg ss5 | stringstream.cpp:41:7:41:9 | ss5 | |
|
||||
| stringstream.cpp:35:7:35:9 | ref arg ss5 | stringstream.cpp:46:7:46:9 | ss5 | |
|
||||
| stringstream.cpp:35:7:35:9 | ss5 | stringstream.cpp:35:11:35:11 | call to operator<< | |
|
||||
| stringstream.cpp:35:14:35:14 | t | stringstream.cpp:35:7:35:9 | ref arg ss5 | TAINT |
|
||||
| stringstream.cpp:35:14:35:14 | t | stringstream.cpp:35:11:35:11 | call to operator<< | TAINT |
|
||||
| stringstream.cpp:48:2:48:4 | ref arg ss6 | stringstream.cpp:49:2:49:4 | ss6 | |
|
||||
| stringstream.cpp:48:2:48:4 | ref arg ss6 | stringstream.cpp:52:7:52:9 | ss6 | |
|
||||
| stringstream.cpp:48:10:48:14 | abc | stringstream.cpp:48:10:48:14 | call to basic_string | TAINT |
|
||||
| stringstream.cpp:49:2:49:4 | ref arg ss6 | stringstream.cpp:52:7:52:9 | ss6 | |
|
||||
| stringstream.cpp:49:10:49:15 | call to source | stringstream.cpp:49:10:49:17 | call to basic_string | TAINT |
|
||||
| stringstream.cpp:50:2:50:4 | ref arg ss7 | stringstream.cpp:51:2:51:4 | ss7 | |
|
||||
| stringstream.cpp:50:2:50:4 | ref arg ss7 | stringstream.cpp:53:7:53:9 | ss7 | |
|
||||
| stringstream.cpp:50:10:50:15 | call to source | stringstream.cpp:50:10:50:17 | call to basic_string | TAINT |
|
||||
| stringstream.cpp:51:2:51:4 | ref arg ss7 | stringstream.cpp:53:7:53:9 | ss7 | |
|
||||
| stringstream.cpp:51:10:51:14 | abc | stringstream.cpp:51:10:51:14 | call to basic_string | TAINT |
|
||||
| stringstream.cpp:55:7:55:9 | ref arg ss8 | stringstream.cpp:58:7:58:9 | ss8 | |
|
||||
| stringstream.cpp:56:7:56:9 | ref arg ss9 | stringstream.cpp:59:7:59:9 | ss9 | |
|
||||
| stringstream.cpp:57:7:57:10 | ref arg ss10 | stringstream.cpp:60:7:60:10 | ss10 | |
|
||||
| stringstream.cpp:62:7:62:10 | ref arg ss11 | stringstream.cpp:65:7:65:10 | ss11 | |
|
||||
| stringstream.cpp:63:7:63:10 | ref arg ss12 | stringstream.cpp:66:7:66:10 | ss12 | |
|
||||
| stringstream.cpp:64:7:64:10 | ref arg ss13 | stringstream.cpp:67:7:67:10 | ss13 | |
|
||||
| stringstream.cpp:70:32:70:37 | source | stringstream.cpp:76:14:76:19 | source | |
|
||||
| stringstream.cpp:72:20:72:22 | call to basic_stringstream | stringstream.cpp:75:7:75:9 | ss1 | |
|
||||
| stringstream.cpp:72:20:72:22 | call to basic_stringstream | stringstream.cpp:77:7:77:9 | ss1 | |
|
||||
| stringstream.cpp:72:20:72:22 | call to basic_stringstream | stringstream.cpp:80:7:80:9 | ss1 | |
|
||||
| stringstream.cpp:72:20:72:22 | call to basic_stringstream | stringstream.cpp:82:7:82:9 | ss1 | |
|
||||
| stringstream.cpp:72:25:72:27 | call to basic_stringstream | stringstream.cpp:76:7:76:9 | ss2 | |
|
||||
| stringstream.cpp:72:25:72:27 | call to basic_stringstream | stringstream.cpp:78:7:78:9 | ss2 | |
|
||||
| stringstream.cpp:72:25:72:27 | call to basic_stringstream | stringstream.cpp:81:7:81:9 | ss2 | |
|
||||
| stringstream.cpp:72:25:72:27 | call to basic_stringstream | stringstream.cpp:83:7:83:9 | ss2 | |
|
||||
| stringstream.cpp:73:10:73:11 | 0 | stringstream.cpp:77:14:77:15 | v1 | |
|
||||
| stringstream.cpp:73:10:73:11 | 0 | stringstream.cpp:84:7:84:8 | v1 | |
|
||||
| stringstream.cpp:73:18:73:19 | 0 | stringstream.cpp:78:14:78:15 | v2 | |
|
||||
| stringstream.cpp:73:18:73:19 | 0 | stringstream.cpp:85:7:85:8 | v2 | |
|
||||
| stringstream.cpp:75:7:75:9 | ref arg ss1 | stringstream.cpp:77:7:77:9 | ss1 | |
|
||||
| stringstream.cpp:75:7:75:9 | ref arg ss1 | stringstream.cpp:80:7:80:9 | ss1 | |
|
||||
| stringstream.cpp:75:7:75:9 | ref arg ss1 | stringstream.cpp:82:7:82:9 | ss1 | |
|
||||
| stringstream.cpp:75:14:75:17 | 1234 | stringstream.cpp:75:7:75:9 | ref arg ss1 | TAINT |
|
||||
| stringstream.cpp:75:14:75:17 | 1234 | stringstream.cpp:75:11:75:11 | call to operator<< | TAINT |
|
||||
| stringstream.cpp:76:7:76:9 | ref arg ss2 | stringstream.cpp:78:7:78:9 | ss2 | |
|
||||
| stringstream.cpp:76:7:76:9 | ref arg ss2 | stringstream.cpp:81:7:81:9 | ss2 | |
|
||||
| stringstream.cpp:76:7:76:9 | ref arg ss2 | stringstream.cpp:83:7:83:9 | ss2 | |
|
||||
| stringstream.cpp:76:14:76:19 | source | stringstream.cpp:76:7:76:9 | ref arg ss2 | TAINT |
|
||||
| stringstream.cpp:76:14:76:19 | source | stringstream.cpp:76:11:76:11 | call to operator<< | TAINT |
|
||||
| stringstream.cpp:77:7:77:9 | ref arg ss1 | stringstream.cpp:80:7:80:9 | ss1 | |
|
||||
| stringstream.cpp:77:7:77:9 | ref arg ss1 | stringstream.cpp:82:7:82:9 | ss1 | |
|
||||
| stringstream.cpp:77:14:77:15 | ref arg v1 | stringstream.cpp:84:7:84:8 | v1 | |
|
||||
| stringstream.cpp:78:7:78:9 | ref arg ss2 | stringstream.cpp:81:7:81:9 | ss2 | |
|
||||
| stringstream.cpp:78:7:78:9 | ref arg ss2 | stringstream.cpp:83:7:83:9 | ss2 | |
|
||||
| stringstream.cpp:78:14:78:15 | ref arg v2 | stringstream.cpp:85:7:85:8 | v2 | |
|
||||
| stringstream.cpp:90:18:90:23 | call to basic_string | stringstream.cpp:92:24:92:25 | s1 | |
|
||||
| stringstream.cpp:90:19:90:23 | abc | stringstream.cpp:90:18:90:23 | call to basic_string | TAINT |
|
||||
| stringstream.cpp:91:18:91:26 | call to basic_string | stringstream.cpp:93:24:93:25 | s2 | |
|
||||
| stringstream.cpp:91:19:91:24 | call to source | stringstream.cpp:91:18:91:26 | call to basic_string | TAINT |
|
||||
| stringstream.cpp:92:24:92:26 | call to basic_stringstream | stringstream.cpp:102:7:102:9 | ss1 | |
|
||||
| stringstream.cpp:93:24:93:26 | call to basic_stringstream | stringstream.cpp:103:7:103:9 | ss2 | |
|
||||
| stringstream.cpp:94:25:94:49 | call to basic_stringstream | stringstream.cpp:104:7:104:9 | ss3 | |
|
||||
| stringstream.cpp:94:44:94:48 | abc | stringstream.cpp:94:44:94:48 | call to basic_string | TAINT |
|
||||
| stringstream.cpp:95:25:95:52 | call to basic_stringstream | stringstream.cpp:105:7:105:9 | ss4 | |
|
||||
| stringstream.cpp:95:44:95:49 | call to source | stringstream.cpp:95:44:95:51 | call to basic_string | TAINT |
|
||||
| stringstream.cpp:96:20:96:22 | call to basic_stringstream | stringstream.cpp:99:7:99:9 | ss5 | |
|
||||
| stringstream.cpp:96:20:96:22 | call to basic_stringstream | stringstream.cpp:106:7:106:9 | ss5 | |
|
||||
| stringstream.cpp:97:20:97:22 | call to basic_stringstream | stringstream.cpp:100:7:100:9 | ss6 | |
|
||||
| stringstream.cpp:97:20:97:22 | call to basic_stringstream | stringstream.cpp:107:7:107:9 | ss6 | |
|
||||
| stringstream.cpp:99:7:99:9 | ref arg ss5 | stringstream.cpp:106:7:106:9 | ss5 | |
|
||||
| stringstream.cpp:99:13:99:36 | call to basic_stringstream | stringstream.cpp:99:7:99:9 | ref arg ss5 | TAINT |
|
||||
| stringstream.cpp:99:13:99:36 | call to basic_stringstream | stringstream.cpp:99:11:99:11 | call to operator= | TAINT |
|
||||
| stringstream.cpp:99:31:99:35 | abc | stringstream.cpp:99:31:99:35 | call to basic_string | TAINT |
|
||||
| stringstream.cpp:100:7:100:9 | ref arg ss6 | stringstream.cpp:107:7:107:9 | ss6 | |
|
||||
| stringstream.cpp:100:13:100:39 | call to basic_stringstream | stringstream.cpp:100:7:100:9 | ref arg ss6 | TAINT |
|
||||
| stringstream.cpp:100:13:100:39 | call to basic_stringstream | stringstream.cpp:100:11:100:11 | call to operator= | TAINT |
|
||||
| stringstream.cpp:100:31:100:36 | call to source | stringstream.cpp:100:31:100:38 | call to basic_string | TAINT |
|
||||
| stringstream.cpp:112:24:112:28 | abc | stringstream.cpp:112:24:112:28 | call to basic_string | TAINT |
|
||||
| stringstream.cpp:112:24:112:29 | call to basic_stringstream | stringstream.cpp:117:2:117:4 | ss1 | |
|
||||
| stringstream.cpp:112:24:112:29 | call to basic_stringstream | stringstream.cpp:120:7:120:9 | ss1 | |
|
||||
| stringstream.cpp:113:24:113:29 | call to source | stringstream.cpp:113:24:113:31 | call to basic_string | TAINT |
|
||||
| stringstream.cpp:113:24:113:32 | call to basic_stringstream | stringstream.cpp:117:11:117:13 | ss2 | |
|
||||
| stringstream.cpp:113:24:113:32 | call to basic_stringstream | stringstream.cpp:121:7:121:9 | ss2 | |
|
||||
| stringstream.cpp:114:24:114:28 | abc | stringstream.cpp:114:24:114:28 | call to basic_string | TAINT |
|
||||
| stringstream.cpp:114:24:114:29 | call to basic_stringstream | stringstream.cpp:118:11:118:13 | ss3 | |
|
||||
| stringstream.cpp:114:24:114:29 | call to basic_stringstream | stringstream.cpp:122:7:122:9 | ss3 | |
|
||||
| stringstream.cpp:115:24:115:29 | call to source | stringstream.cpp:115:24:115:31 | call to basic_string | TAINT |
|
||||
| stringstream.cpp:115:24:115:32 | call to basic_stringstream | stringstream.cpp:118:2:118:4 | ss4 | |
|
||||
| stringstream.cpp:115:24:115:32 | call to basic_stringstream | stringstream.cpp:123:7:123:9 | ss4 | |
|
||||
| stringstream.cpp:117:2:117:4 | ref arg ss1 | stringstream.cpp:120:7:120:9 | ss1 | |
|
||||
| stringstream.cpp:117:11:117:13 | ref arg ss2 | stringstream.cpp:121:7:121:9 | ss2 | |
|
||||
| stringstream.cpp:118:2:118:4 | ref arg ss4 | stringstream.cpp:123:7:123:9 | ss4 | |
|
||||
| stringstream.cpp:118:11:118:13 | ref arg ss3 | stringstream.cpp:122:7:122:9 | ss3 | |
|
||||
| stringstream.cpp:128:20:128:22 | call to basic_stringstream | stringstream.cpp:142:7:142:9 | ss1 | |
|
||||
| stringstream.cpp:128:20:128:22 | call to basic_stringstream | stringstream.cpp:145:7:145:9 | ss1 | |
|
||||
| stringstream.cpp:128:20:128:22 | call to basic_stringstream | stringstream.cpp:153:7:153:9 | ss1 | |
|
||||
| stringstream.cpp:128:20:128:22 | call to basic_stringstream | stringstream.cpp:161:7:161:9 | ss1 | |
|
||||
| stringstream.cpp:128:20:128:22 | call to basic_stringstream | stringstream.cpp:163:7:163:9 | ss1 | |
|
||||
| stringstream.cpp:128:20:128:22 | call to basic_stringstream | stringstream.cpp:165:7:165:9 | ss1 | |
|
||||
| stringstream.cpp:128:20:128:22 | call to basic_stringstream | stringstream.cpp:174:12:174:14 | ss1 | |
|
||||
| stringstream.cpp:128:20:128:22 | call to basic_stringstream | stringstream.cpp:176:12:176:14 | ss1 | |
|
||||
| stringstream.cpp:128:20:128:22 | call to basic_stringstream | stringstream.cpp:178:7:178:9 | ss1 | |
|
||||
| stringstream.cpp:128:25:128:27 | call to basic_stringstream | stringstream.cpp:143:7:143:9 | ss2 | |
|
||||
| stringstream.cpp:128:25:128:27 | call to basic_stringstream | stringstream.cpp:146:7:146:9 | ss2 | |
|
||||
| stringstream.cpp:128:25:128:27 | call to basic_stringstream | stringstream.cpp:147:7:147:9 | ss2 | |
|
||||
| stringstream.cpp:128:25:128:27 | call to basic_stringstream | stringstream.cpp:154:7:154:9 | ss2 | |
|
||||
| stringstream.cpp:128:25:128:27 | call to basic_stringstream | stringstream.cpp:155:7:155:9 | ss2 | |
|
||||
| stringstream.cpp:128:25:128:27 | call to basic_stringstream | stringstream.cpp:162:7:162:9 | ss2 | |
|
||||
| stringstream.cpp:128:25:128:27 | call to basic_stringstream | stringstream.cpp:164:7:164:9 | ss2 | |
|
||||
| stringstream.cpp:128:25:128:27 | call to basic_stringstream | stringstream.cpp:166:7:166:9 | ss2 | |
|
||||
| stringstream.cpp:128:25:128:27 | call to basic_stringstream | stringstream.cpp:175:12:175:14 | ss2 | |
|
||||
| stringstream.cpp:128:25:128:27 | call to basic_stringstream | stringstream.cpp:177:12:177:14 | ss2 | |
|
||||
| stringstream.cpp:128:25:128:27 | call to basic_stringstream | stringstream.cpp:179:7:179:9 | ss2 | |
|
||||
| stringstream.cpp:129:14:129:15 | call to basic_string | stringstream.cpp:145:14:145:15 | s1 | |
|
||||
| stringstream.cpp:129:14:129:15 | call to basic_string | stringstream.cpp:148:7:148:8 | s1 | |
|
||||
| stringstream.cpp:129:18:129:19 | call to basic_string | stringstream.cpp:146:14:146:15 | s2 | |
|
||||
| stringstream.cpp:129:18:129:19 | call to basic_string | stringstream.cpp:149:7:149:8 | s2 | |
|
||||
| stringstream.cpp:129:22:129:23 | call to basic_string | stringstream.cpp:147:14:147:15 | s3 | |
|
||||
| stringstream.cpp:129:22:129:23 | call to basic_string | stringstream.cpp:150:7:150:8 | s3 | |
|
||||
| stringstream.cpp:129:26:129:27 | call to basic_string | stringstream.cpp:147:20:147:21 | s4 | |
|
||||
| stringstream.cpp:129:26:129:27 | call to basic_string | stringstream.cpp:151:7:151:8 | s4 | |
|
||||
| stringstream.cpp:130:16:130:19 | {...} | stringstream.cpp:153:14:153:15 | b1 | |
|
||||
| stringstream.cpp:130:16:130:19 | {...} | stringstream.cpp:156:7:156:8 | b1 | |
|
||||
| stringstream.cpp:130:18:130:18 | 0 | stringstream.cpp:130:16:130:19 | {...} | TAINT |
|
||||
| stringstream.cpp:131:16:131:19 | {...} | stringstream.cpp:154:14:154:15 | b2 | |
|
||||
| stringstream.cpp:131:16:131:19 | {...} | stringstream.cpp:157:7:157:8 | b2 | |
|
||||
| stringstream.cpp:131:18:131:18 | 0 | stringstream.cpp:131:16:131:19 | {...} | TAINT |
|
||||
| stringstream.cpp:132:16:132:19 | {...} | stringstream.cpp:155:14:155:15 | b3 | |
|
||||
| stringstream.cpp:132:16:132:19 | {...} | stringstream.cpp:158:7:158:8 | b3 | |
|
||||
| stringstream.cpp:132:18:132:18 | 0 | stringstream.cpp:132:16:132:19 | {...} | TAINT |
|
||||
| stringstream.cpp:133:16:133:19 | {...} | stringstream.cpp:155:20:155:21 | b4 | |
|
||||
| stringstream.cpp:133:16:133:19 | {...} | stringstream.cpp:159:7:159:8 | b4 | |
|
||||
| stringstream.cpp:133:18:133:18 | 0 | stringstream.cpp:133:16:133:19 | {...} | TAINT |
|
||||
| stringstream.cpp:134:16:134:19 | {...} | stringstream.cpp:161:16:161:17 | b5 | |
|
||||
| stringstream.cpp:134:16:134:19 | {...} | stringstream.cpp:167:7:167:8 | b5 | |
|
||||
| stringstream.cpp:134:18:134:18 | 0 | stringstream.cpp:134:16:134:19 | {...} | TAINT |
|
||||
| stringstream.cpp:135:16:135:19 | {...} | stringstream.cpp:162:16:162:17 | b6 | |
|
||||
| stringstream.cpp:135:16:135:19 | {...} | stringstream.cpp:168:7:168:8 | b6 | |
|
||||
| stringstream.cpp:135:18:135:18 | 0 | stringstream.cpp:135:16:135:19 | {...} | TAINT |
|
||||
| stringstream.cpp:136:16:136:19 | {...} | stringstream.cpp:163:20:163:21 | b7 | |
|
||||
| stringstream.cpp:136:16:136:19 | {...} | stringstream.cpp:169:7:169:8 | b7 | |
|
||||
| stringstream.cpp:136:18:136:18 | 0 | stringstream.cpp:136:16:136:19 | {...} | TAINT |
|
||||
| stringstream.cpp:137:16:137:19 | {...} | stringstream.cpp:164:20:164:21 | b8 | |
|
||||
| stringstream.cpp:137:16:137:19 | {...} | stringstream.cpp:170:7:170:8 | b8 | |
|
||||
| stringstream.cpp:137:18:137:18 | 0 | stringstream.cpp:137:16:137:19 | {...} | TAINT |
|
||||
| stringstream.cpp:138:16:138:19 | {...} | stringstream.cpp:165:15:165:16 | b9 | |
|
||||
| stringstream.cpp:138:16:138:19 | {...} | stringstream.cpp:171:7:171:8 | b9 | |
|
||||
| stringstream.cpp:138:18:138:18 | 0 | stringstream.cpp:138:16:138:19 | {...} | TAINT |
|
||||
| stringstream.cpp:139:17:139:20 | {...} | stringstream.cpp:166:15:166:17 | b10 | |
|
||||
| stringstream.cpp:139:17:139:20 | {...} | stringstream.cpp:172:7:172:9 | b10 | |
|
||||
| stringstream.cpp:139:19:139:19 | 0 | stringstream.cpp:139:17:139:20 | {...} | TAINT |
|
||||
| stringstream.cpp:140:44:140:44 | 0 | stringstream.cpp:178:15:178:16 | c5 | |
|
||||
| stringstream.cpp:140:44:140:44 | 0 | stringstream.cpp:184:7:184:8 | c5 | |
|
||||
| stringstream.cpp:140:52:140:52 | 0 | stringstream.cpp:179:15:179:16 | c6 | |
|
||||
| stringstream.cpp:140:52:140:52 | 0 | stringstream.cpp:185:7:185:8 | c6 | |
|
||||
| stringstream.cpp:142:7:142:9 | ref arg ss1 | stringstream.cpp:145:7:145:9 | ss1 | |
|
||||
| stringstream.cpp:142:7:142:9 | ref arg ss1 | stringstream.cpp:153:7:153:9 | ss1 | |
|
||||
| stringstream.cpp:142:7:142:9 | ref arg ss1 | stringstream.cpp:161:7:161:9 | ss1 | |
|
||||
| stringstream.cpp:142:7:142:9 | ref arg ss1 | stringstream.cpp:163:7:163:9 | ss1 | |
|
||||
| stringstream.cpp:142:7:142:9 | ref arg ss1 | stringstream.cpp:165:7:165:9 | ss1 | |
|
||||
| stringstream.cpp:142:7:142:9 | ref arg ss1 | stringstream.cpp:174:12:174:14 | ss1 | |
|
||||
| stringstream.cpp:142:7:142:9 | ref arg ss1 | stringstream.cpp:176:12:176:14 | ss1 | |
|
||||
| stringstream.cpp:142:7:142:9 | ref arg ss1 | stringstream.cpp:178:7:178:9 | ss1 | |
|
||||
| stringstream.cpp:142:7:142:9 | ss1 | stringstream.cpp:142:11:142:11 | call to operator<< | |
|
||||
| stringstream.cpp:142:14:142:18 | abc | stringstream.cpp:142:7:142:9 | ref arg ss1 | TAINT |
|
||||
| stringstream.cpp:142:14:142:18 | abc | stringstream.cpp:142:11:142:11 | call to operator<< | TAINT |
|
||||
| stringstream.cpp:143:7:143:9 | ref arg ss2 | stringstream.cpp:146:7:146:9 | ss2 | |
|
||||
| stringstream.cpp:143:7:143:9 | ref arg ss2 | stringstream.cpp:147:7:147:9 | ss2 | |
|
||||
| stringstream.cpp:143:7:143:9 | ref arg ss2 | stringstream.cpp:154:7:154:9 | ss2 | |
|
||||
| stringstream.cpp:143:7:143:9 | ref arg ss2 | stringstream.cpp:155:7:155:9 | ss2 | |
|
||||
| stringstream.cpp:143:7:143:9 | ref arg ss2 | stringstream.cpp:162:7:162:9 | ss2 | |
|
||||
| stringstream.cpp:143:7:143:9 | ref arg ss2 | stringstream.cpp:164:7:164:9 | ss2 | |
|
||||
| stringstream.cpp:143:7:143:9 | ref arg ss2 | stringstream.cpp:166:7:166:9 | ss2 | |
|
||||
| stringstream.cpp:143:7:143:9 | ref arg ss2 | stringstream.cpp:175:12:175:14 | ss2 | |
|
||||
| stringstream.cpp:143:7:143:9 | ref arg ss2 | stringstream.cpp:177:12:177:14 | ss2 | |
|
||||
| stringstream.cpp:143:7:143:9 | ref arg ss2 | stringstream.cpp:179:7:179:9 | ss2 | |
|
||||
| stringstream.cpp:143:7:143:9 | ss2 | stringstream.cpp:143:11:143:11 | call to operator<< | |
|
||||
| stringstream.cpp:143:14:143:19 | call to source | stringstream.cpp:143:7:143:9 | ref arg ss2 | TAINT |
|
||||
| stringstream.cpp:143:14:143:19 | call to source | stringstream.cpp:143:11:143:11 | call to operator<< | TAINT |
|
||||
| stringstream.cpp:145:7:145:9 | ref arg ss1 | stringstream.cpp:153:7:153:9 | ss1 | |
|
||||
| stringstream.cpp:145:7:145:9 | ref arg ss1 | stringstream.cpp:161:7:161:9 | ss1 | |
|
||||
| stringstream.cpp:145:7:145:9 | ref arg ss1 | stringstream.cpp:163:7:163:9 | ss1 | |
|
||||
| stringstream.cpp:145:7:145:9 | ref arg ss1 | stringstream.cpp:165:7:165:9 | ss1 | |
|
||||
| stringstream.cpp:145:7:145:9 | ref arg ss1 | stringstream.cpp:174:12:174:14 | ss1 | |
|
||||
| stringstream.cpp:145:7:145:9 | ref arg ss1 | stringstream.cpp:176:12:176:14 | ss1 | |
|
||||
| stringstream.cpp:145:7:145:9 | ref arg ss1 | stringstream.cpp:178:7:178:9 | ss1 | |
|
||||
| stringstream.cpp:145:14:145:15 | ref arg s1 | stringstream.cpp:148:7:148:8 | s1 | |
|
||||
| stringstream.cpp:146:7:146:9 | ref arg ss2 | stringstream.cpp:147:7:147:9 | ss2 | |
|
||||
| stringstream.cpp:146:7:146:9 | ref arg ss2 | stringstream.cpp:154:7:154:9 | ss2 | |
|
||||
| stringstream.cpp:146:7:146:9 | ref arg ss2 | stringstream.cpp:155:7:155:9 | ss2 | |
|
||||
| stringstream.cpp:146:7:146:9 | ref arg ss2 | stringstream.cpp:162:7:162:9 | ss2 | |
|
||||
| stringstream.cpp:146:7:146:9 | ref arg ss2 | stringstream.cpp:164:7:164:9 | ss2 | |
|
||||
| stringstream.cpp:146:7:146:9 | ref arg ss2 | stringstream.cpp:166:7:166:9 | ss2 | |
|
||||
| stringstream.cpp:146:7:146:9 | ref arg ss2 | stringstream.cpp:175:12:175:14 | ss2 | |
|
||||
| stringstream.cpp:146:7:146:9 | ref arg ss2 | stringstream.cpp:177:12:177:14 | ss2 | |
|
||||
| stringstream.cpp:146:7:146:9 | ref arg ss2 | stringstream.cpp:179:7:179:9 | ss2 | |
|
||||
| stringstream.cpp:146:14:146:15 | ref arg s2 | stringstream.cpp:149:7:149:8 | s2 | |
|
||||
| stringstream.cpp:147:7:147:9 | ref arg ss2 | stringstream.cpp:154:7:154:9 | ss2 | |
|
||||
| stringstream.cpp:147:7:147:9 | ref arg ss2 | stringstream.cpp:155:7:155:9 | ss2 | |
|
||||
| stringstream.cpp:147:7:147:9 | ref arg ss2 | stringstream.cpp:162:7:162:9 | ss2 | |
|
||||
| stringstream.cpp:147:7:147:9 | ref arg ss2 | stringstream.cpp:164:7:164:9 | ss2 | |
|
||||
| stringstream.cpp:147:7:147:9 | ref arg ss2 | stringstream.cpp:166:7:166:9 | ss2 | |
|
||||
| stringstream.cpp:147:7:147:9 | ref arg ss2 | stringstream.cpp:175:12:175:14 | ss2 | |
|
||||
| stringstream.cpp:147:7:147:9 | ref arg ss2 | stringstream.cpp:177:12:177:14 | ss2 | |
|
||||
| stringstream.cpp:147:7:147:9 | ref arg ss2 | stringstream.cpp:179:7:179:9 | ss2 | |
|
||||
| stringstream.cpp:147:14:147:15 | ref arg s3 | stringstream.cpp:150:7:150:8 | s3 | |
|
||||
| stringstream.cpp:147:20:147:21 | ref arg s4 | stringstream.cpp:151:7:151:8 | s4 | |
|
||||
| stringstream.cpp:153:7:153:9 | ref arg ss1 | stringstream.cpp:161:7:161:9 | ss1 | |
|
||||
| stringstream.cpp:153:7:153:9 | ref arg ss1 | stringstream.cpp:163:7:163:9 | ss1 | |
|
||||
| stringstream.cpp:153:7:153:9 | ref arg ss1 | stringstream.cpp:165:7:165:9 | ss1 | |
|
||||
| stringstream.cpp:153:7:153:9 | ref arg ss1 | stringstream.cpp:174:12:174:14 | ss1 | |
|
||||
| stringstream.cpp:153:7:153:9 | ref arg ss1 | stringstream.cpp:176:12:176:14 | ss1 | |
|
||||
| stringstream.cpp:153:7:153:9 | ref arg ss1 | stringstream.cpp:178:7:178:9 | ss1 | |
|
||||
| stringstream.cpp:153:14:153:15 | ref arg b1 | stringstream.cpp:156:7:156:8 | b1 | |
|
||||
| stringstream.cpp:154:7:154:9 | ref arg ss2 | stringstream.cpp:155:7:155:9 | ss2 | |
|
||||
| stringstream.cpp:154:7:154:9 | ref arg ss2 | stringstream.cpp:162:7:162:9 | ss2 | |
|
||||
| stringstream.cpp:154:7:154:9 | ref arg ss2 | stringstream.cpp:164:7:164:9 | ss2 | |
|
||||
| stringstream.cpp:154:7:154:9 | ref arg ss2 | stringstream.cpp:166:7:166:9 | ss2 | |
|
||||
| stringstream.cpp:154:7:154:9 | ref arg ss2 | stringstream.cpp:175:12:175:14 | ss2 | |
|
||||
| stringstream.cpp:154:7:154:9 | ref arg ss2 | stringstream.cpp:177:12:177:14 | ss2 | |
|
||||
| stringstream.cpp:154:7:154:9 | ref arg ss2 | stringstream.cpp:179:7:179:9 | ss2 | |
|
||||
| stringstream.cpp:154:14:154:15 | ref arg b2 | stringstream.cpp:157:7:157:8 | b2 | |
|
||||
| stringstream.cpp:155:7:155:9 | ref arg ss2 | stringstream.cpp:162:7:162:9 | ss2 | |
|
||||
| stringstream.cpp:155:7:155:9 | ref arg ss2 | stringstream.cpp:164:7:164:9 | ss2 | |
|
||||
| stringstream.cpp:155:7:155:9 | ref arg ss2 | stringstream.cpp:166:7:166:9 | ss2 | |
|
||||
| stringstream.cpp:155:7:155:9 | ref arg ss2 | stringstream.cpp:175:12:175:14 | ss2 | |
|
||||
| stringstream.cpp:155:7:155:9 | ref arg ss2 | stringstream.cpp:177:12:177:14 | ss2 | |
|
||||
| stringstream.cpp:155:7:155:9 | ref arg ss2 | stringstream.cpp:179:7:179:9 | ss2 | |
|
||||
| stringstream.cpp:155:14:155:15 | ref arg b3 | stringstream.cpp:158:7:158:8 | b3 | |
|
||||
| stringstream.cpp:155:20:155:21 | ref arg b4 | stringstream.cpp:159:7:159:8 | b4 | |
|
||||
| stringstream.cpp:156:7:156:8 | b1 | stringstream.cpp:156:7:156:8 | call to basic_string | TAINT |
|
||||
| stringstream.cpp:157:7:157:8 | b2 | stringstream.cpp:157:7:157:8 | call to basic_string | TAINT |
|
||||
| stringstream.cpp:158:7:158:8 | b3 | stringstream.cpp:158:7:158:8 | call to basic_string | TAINT |
|
||||
| stringstream.cpp:159:7:159:8 | b4 | stringstream.cpp:159:7:159:8 | call to basic_string | TAINT |
|
||||
| stringstream.cpp:161:7:161:9 | ref arg ss1 | stringstream.cpp:163:7:163:9 | ss1 | |
|
||||
| stringstream.cpp:161:7:161:9 | ref arg ss1 | stringstream.cpp:165:7:165:9 | ss1 | |
|
||||
| stringstream.cpp:161:7:161:9 | ref arg ss1 | stringstream.cpp:174:12:174:14 | ss1 | |
|
||||
| stringstream.cpp:161:7:161:9 | ref arg ss1 | stringstream.cpp:176:12:176:14 | ss1 | |
|
||||
| stringstream.cpp:161:7:161:9 | ref arg ss1 | stringstream.cpp:178:7:178:9 | ss1 | |
|
||||
| stringstream.cpp:161:16:161:17 | ref arg b5 | stringstream.cpp:167:7:167:8 | b5 | |
|
||||
| stringstream.cpp:162:7:162:9 | ref arg ss2 | stringstream.cpp:164:7:164:9 | ss2 | |
|
||||
| stringstream.cpp:162:7:162:9 | ref arg ss2 | stringstream.cpp:166:7:166:9 | ss2 | |
|
||||
| stringstream.cpp:162:7:162:9 | ref arg ss2 | stringstream.cpp:175:12:175:14 | ss2 | |
|
||||
| stringstream.cpp:162:7:162:9 | ref arg ss2 | stringstream.cpp:177:12:177:14 | ss2 | |
|
||||
| stringstream.cpp:162:7:162:9 | ref arg ss2 | stringstream.cpp:179:7:179:9 | ss2 | |
|
||||
| stringstream.cpp:162:16:162:17 | ref arg b6 | stringstream.cpp:168:7:168:8 | b6 | |
|
||||
| stringstream.cpp:163:7:163:9 | ref arg ss1 | stringstream.cpp:165:7:165:9 | ss1 | |
|
||||
| stringstream.cpp:163:7:163:9 | ref arg ss1 | stringstream.cpp:174:12:174:14 | ss1 | |
|
||||
| stringstream.cpp:163:7:163:9 | ref arg ss1 | stringstream.cpp:176:12:176:14 | ss1 | |
|
||||
| stringstream.cpp:163:7:163:9 | ref arg ss1 | stringstream.cpp:178:7:178:9 | ss1 | |
|
||||
| stringstream.cpp:163:20:163:21 | ref arg b7 | stringstream.cpp:169:7:169:8 | b7 | |
|
||||
| stringstream.cpp:164:7:164:9 | ref arg ss2 | stringstream.cpp:166:7:166:9 | ss2 | |
|
||||
| stringstream.cpp:164:7:164:9 | ref arg ss2 | stringstream.cpp:175:12:175:14 | ss2 | |
|
||||
| stringstream.cpp:164:7:164:9 | ref arg ss2 | stringstream.cpp:177:12:177:14 | ss2 | |
|
||||
| stringstream.cpp:164:7:164:9 | ref arg ss2 | stringstream.cpp:179:7:179:9 | ss2 | |
|
||||
| stringstream.cpp:164:20:164:21 | ref arg b8 | stringstream.cpp:170:7:170:8 | b8 | |
|
||||
| stringstream.cpp:165:7:165:9 | ref arg ss1 | stringstream.cpp:174:12:174:14 | ss1 | |
|
||||
| stringstream.cpp:165:7:165:9 | ref arg ss1 | stringstream.cpp:176:12:176:14 | ss1 | |
|
||||
| stringstream.cpp:165:7:165:9 | ref arg ss1 | stringstream.cpp:178:7:178:9 | ss1 | |
|
||||
| stringstream.cpp:165:15:165:16 | ref arg b9 | stringstream.cpp:171:7:171:8 | b9 | |
|
||||
| stringstream.cpp:166:7:166:9 | ref arg ss2 | stringstream.cpp:175:12:175:14 | ss2 | |
|
||||
| stringstream.cpp:166:7:166:9 | ref arg ss2 | stringstream.cpp:177:12:177:14 | ss2 | |
|
||||
| stringstream.cpp:166:7:166:9 | ref arg ss2 | stringstream.cpp:179:7:179:9 | ss2 | |
|
||||
| stringstream.cpp:166:15:166:17 | ref arg b10 | stringstream.cpp:172:7:172:9 | b10 | |
|
||||
| stringstream.cpp:167:7:167:8 | b5 | stringstream.cpp:167:7:167:8 | call to basic_string | TAINT |
|
||||
| stringstream.cpp:168:7:168:8 | b6 | stringstream.cpp:168:7:168:8 | call to basic_string | TAINT |
|
||||
| stringstream.cpp:169:7:169:8 | b7 | stringstream.cpp:169:7:169:8 | call to basic_string | TAINT |
|
||||
| stringstream.cpp:170:7:170:8 | b8 | stringstream.cpp:170:7:170:8 | call to basic_string | TAINT |
|
||||
| stringstream.cpp:171:7:171:8 | b9 | stringstream.cpp:171:7:171:8 | call to basic_string | TAINT |
|
||||
| stringstream.cpp:172:7:172:9 | b10 | stringstream.cpp:172:7:172:9 | call to basic_string | TAINT |
|
||||
| stringstream.cpp:174:12:174:14 | ref arg ss1 | stringstream.cpp:176:12:176:14 | ss1 | |
|
||||
| stringstream.cpp:174:12:174:14 | ref arg ss1 | stringstream.cpp:178:7:178:9 | ss1 | |
|
||||
| stringstream.cpp:174:16:174:18 | call to get | stringstream.cpp:174:7:174:20 | ... = ... | |
|
||||
| stringstream.cpp:174:16:174:18 | call to get | stringstream.cpp:180:7:180:8 | c1 | |
|
||||
| stringstream.cpp:175:12:175:14 | ref arg ss2 | stringstream.cpp:177:12:177:14 | ss2 | |
|
||||
| stringstream.cpp:175:12:175:14 | ref arg ss2 | stringstream.cpp:179:7:179:9 | ss2 | |
|
||||
| stringstream.cpp:175:16:175:18 | call to get | stringstream.cpp:175:7:175:20 | ... = ... | |
|
||||
| stringstream.cpp:175:16:175:18 | call to get | stringstream.cpp:181:7:181:8 | c2 | |
|
||||
| stringstream.cpp:176:12:176:14 | ref arg ss1 | stringstream.cpp:178:7:178:9 | ss1 | |
|
||||
| stringstream.cpp:176:16:176:19 | call to peek | stringstream.cpp:176:7:176:21 | ... = ... | |
|
||||
| stringstream.cpp:176:16:176:19 | call to peek | stringstream.cpp:182:7:182:8 | c3 | |
|
||||
| stringstream.cpp:177:12:177:14 | ref arg ss2 | stringstream.cpp:179:7:179:9 | ss2 | |
|
||||
| stringstream.cpp:177:16:177:19 | call to peek | stringstream.cpp:177:7:177:21 | ... = ... | |
|
||||
| stringstream.cpp:177:16:177:19 | call to peek | stringstream.cpp:183:7:183:8 | c4 | |
|
||||
| stringstream.cpp:178:15:178:16 | ref arg c5 | stringstream.cpp:184:7:184:8 | c5 | |
|
||||
| stringstream.cpp:179:15:179:16 | ref arg c6 | stringstream.cpp:185:7:185:8 | c6 | |
|
||||
| stringstream.cpp:190:20:190:21 | call to basic_stringstream | stringstream.cpp:192:7:192:8 | ss | |
|
||||
| stringstream.cpp:190:20:190:21 | call to basic_stringstream | stringstream.cpp:193:7:193:8 | ss | |
|
||||
| stringstream.cpp:190:20:190:21 | call to basic_stringstream | stringstream.cpp:194:7:194:8 | ss | |
|
||||
| stringstream.cpp:190:20:190:21 | call to basic_stringstream | stringstream.cpp:195:7:195:8 | ss | |
|
||||
| stringstream.cpp:190:20:190:21 | call to basic_stringstream | stringstream.cpp:196:7:196:8 | ss | |
|
||||
| stringstream.cpp:190:20:190:21 | call to basic_stringstream | stringstream.cpp:197:7:197:8 | ss | |
|
||||
| stringstream.cpp:192:7:192:8 | ref arg ss | stringstream.cpp:193:7:193:8 | ss | |
|
||||
| stringstream.cpp:192:7:192:8 | ref arg ss | stringstream.cpp:194:7:194:8 | ss | |
|
||||
| stringstream.cpp:192:7:192:8 | ref arg ss | stringstream.cpp:195:7:195:8 | ss | |
|
||||
| stringstream.cpp:192:7:192:8 | ref arg ss | stringstream.cpp:196:7:196:8 | ss | |
|
||||
| stringstream.cpp:192:7:192:8 | ref arg ss | stringstream.cpp:197:7:197:8 | ss | |
|
||||
| stringstream.cpp:193:7:193:8 | ref arg ss | stringstream.cpp:194:7:194:8 | ss | |
|
||||
| stringstream.cpp:193:7:193:8 | ref arg ss | stringstream.cpp:195:7:195:8 | ss | |
|
||||
| stringstream.cpp:193:7:193:8 | ref arg ss | stringstream.cpp:196:7:196:8 | ss | |
|
||||
| stringstream.cpp:193:7:193:8 | ref arg ss | stringstream.cpp:197:7:197:8 | ss | |
|
||||
| stringstream.cpp:194:7:194:8 | ref arg ss | stringstream.cpp:195:7:195:8 | ss | |
|
||||
| stringstream.cpp:194:7:194:8 | ref arg ss | stringstream.cpp:196:7:196:8 | ss | |
|
||||
| stringstream.cpp:194:7:194:8 | ref arg ss | stringstream.cpp:197:7:197:8 | ss | |
|
||||
| stringstream.cpp:195:7:195:8 | ref arg ss | stringstream.cpp:196:7:196:8 | ss | |
|
||||
| stringstream.cpp:195:7:195:8 | ref arg ss | stringstream.cpp:197:7:197:8 | ss | |
|
||||
| stringstream.cpp:196:7:196:8 | ref arg ss | stringstream.cpp:197:7:197:8 | ss | |
|
||||
| structlikeclass.cpp:5:7:5:7 | Unknown literal | structlikeclass.cpp:5:7:5:7 | constructor init of field v | TAINT |
|
||||
| structlikeclass.cpp:5:7:5:7 | Unknown literal | structlikeclass.cpp:5:7:5:7 | constructor init of field v | TAINT |
|
||||
| structlikeclass.cpp:5:7:5:7 | this | structlikeclass.cpp:5:7:5:7 | constructor init of field v [pre-this] | |
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
#include "stl.h"
|
||||
|
||||
int source();
|
||||
void sink(int);
|
||||
void sink(int*);
|
||||
|
||||
template<typename T> void sink(std::shared_ptr<T>&);
|
||||
template<typename T> void sink(std::unique_ptr<T>&);
|
||||
|
||||
void test_make_shared() {
|
||||
std::shared_ptr<int> p = std::make_shared<int>(source());
|
||||
sink(*p); // tainted
|
||||
sink(p); // tainted
|
||||
}
|
||||
|
||||
void test_make_shared_array() {
|
||||
std::shared_ptr<int[]> p = std::make_shared<int[]>(source());
|
||||
sink(*p); // not tainted
|
||||
sink(p); // not tainted
|
||||
}
|
||||
|
||||
void test_make_unique() {
|
||||
std::unique_ptr<int> p = std::make_unique<int>(source());
|
||||
sink(*p); // tainted
|
||||
sink(p); // tainted
|
||||
}
|
||||
|
||||
void test_make_unique_array() {
|
||||
std::unique_ptr<int[]> p = std::make_unique<int[]>(source());
|
||||
sink(*p); // not tainted
|
||||
sink(p); // not tainted
|
||||
}
|
||||
|
||||
void test_reverse_taint_shared() {
|
||||
std::shared_ptr<int> p = std::make_shared<int>();
|
||||
|
||||
*p = source();
|
||||
sink(p); // tainted [NOT DETECTED]
|
||||
sink(*p); // tainted [NOT DETECTED]
|
||||
}
|
||||
|
||||
void test_reverse_taint_unique() {
|
||||
std::unique_ptr<int> p = std::unique_ptr<int>();
|
||||
|
||||
*p = source();
|
||||
sink(p); // tainted [NOT DETECTED]
|
||||
sink(*p); // tainted [NOT DETECTED]
|
||||
}
|
||||
|
||||
void test_shared_get() {
|
||||
std::shared_ptr<int> p = std::make_shared<int>(source());
|
||||
sink(p.get()); // tainted
|
||||
}
|
||||
|
||||
void test_unique_get() {
|
||||
std::unique_ptr<int> p = std::make_unique<int>(source());
|
||||
sink(p.get()); // tainted
|
||||
}
|
||||
|
||||
struct A {
|
||||
int x, y;
|
||||
};
|
||||
|
||||
void test_shared_field_member() {
|
||||
std::unique_ptr<A> p = std::make_unique<A>(source(), 0);
|
||||
sink(p->x); // tainted [NOT DETECTED]
|
||||
sink(p->y); // not tainted
|
||||
}
|
||||
@@ -132,16 +132,33 @@ namespace std
|
||||
template <class charT, class traits = char_traits<charT> >
|
||||
class basic_istream /*: virtual public basic_ios<charT,traits> - not needed for this test */ {
|
||||
public:
|
||||
basic_istream<charT,traits>& operator>>(int& n);
|
||||
using char_type = charT;
|
||||
using int_type = int; //typename traits::int_type;
|
||||
|
||||
basic_istream<charT, traits>& operator>>(int& n);
|
||||
|
||||
int_type get();
|
||||
basic_istream<charT, traits>& get(char_type& c);
|
||||
basic_istream<charT, traits>& get(char_type* s, streamsize n);
|
||||
int_type peek();
|
||||
basic_istream<charT, traits>& read (char_type* s, streamsize n);
|
||||
streamsize readsome(char_type* s, streamsize n);
|
||||
basic_istream<charT, traits>& putback(char_type c);
|
||||
|
||||
};
|
||||
|
||||
template<class charT, class traits> basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>&, charT*);
|
||||
template<class charT, class traits, class Allocator> basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>& is, basic_string<charT, traits, Allocator>& str);
|
||||
|
||||
template <class charT, class traits = char_traits<charT> >
|
||||
class basic_ostream /*: virtual public basic_ios<charT,traits> - not needed for this test */ {
|
||||
public:
|
||||
typedef charT char_type;
|
||||
basic_ostream<charT,traits>& write(const char_type* s, streamsize n);
|
||||
|
||||
basic_ostream<charT, traits>& operator<<(int n);
|
||||
|
||||
basic_ostream<charT, traits>& put(char_type c);
|
||||
basic_ostream<charT, traits>& write(const char_type* s, streamsize n);
|
||||
};
|
||||
|
||||
template<class charT, class traits> basic_ostream<charT,traits>& operator<<(basic_ostream<charT,traits>&, const charT*);
|
||||
@@ -156,8 +173,16 @@ namespace std
|
||||
class basic_stringstream : public basic_iostream<charT, traits> {
|
||||
public:
|
||||
explicit basic_stringstream(/*ios_base::openmode which = ios_base::out|ios_base::in - not needed for this test*/);
|
||||
explicit basic_stringstream( const basic_string<charT, traits, Allocator>& str/*, ios_base::openmode which = ios_base::out | ios_base::in*/);
|
||||
basic_stringstream(const basic_stringstream& rhs) = delete;
|
||||
basic_stringstream(basic_stringstream&& rhs);
|
||||
basic_stringstream& operator=(const basic_stringstream& rhs) = delete;
|
||||
basic_stringstream& operator=(basic_stringstream&& rhs);
|
||||
|
||||
void swap(basic_stringstream& rhs);
|
||||
|
||||
basic_string<charT, traits, Allocator> str() const;
|
||||
void str(const basic_string<charT, traits, Allocator>& str);
|
||||
};
|
||||
|
||||
using stringstream = basic_stringstream<char>;
|
||||
@@ -224,3 +249,43 @@ namespace std {
|
||||
void clear() noexcept;
|
||||
};
|
||||
}
|
||||
|
||||
// --- make_shared / make_unique ---
|
||||
|
||||
namespace std {
|
||||
template<typename T>
|
||||
class shared_ptr {
|
||||
public:
|
||||
shared_ptr() noexcept;
|
||||
explicit shared_ptr(T*);
|
||||
template<class U> shared_ptr(const shared_ptr<U>&) noexcept;
|
||||
template<class U> shared_ptr(shared_ptr<U>&&) noexcept;
|
||||
|
||||
shared_ptr<T>& operator=(const shared_ptr<T>&) noexcept;
|
||||
shared_ptr<T>& operator=(shared_ptr<T>&&) noexcept;
|
||||
|
||||
T& operator*() const noexcept;
|
||||
T* operator->() const noexcept;
|
||||
|
||||
T* get() const noexcept;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
class unique_ptr {
|
||||
public:
|
||||
constexpr unique_ptr() noexcept;
|
||||
explicit unique_ptr(T*) noexcept;
|
||||
unique_ptr(unique_ptr<T>&&) noexcept;
|
||||
|
||||
unique_ptr<T>& operator=(unique_ptr<T>&&) noexcept;
|
||||
|
||||
T& operator*() const;
|
||||
T* operator->() const noexcept;
|
||||
|
||||
T* get() const noexcept;
|
||||
};
|
||||
|
||||
template<typename T, class... Args> unique_ptr<T> make_unique(Args&&...);
|
||||
|
||||
template<typename T, class... Args> shared_ptr<T> make_shared(Args&&...);
|
||||
}
|
||||
@@ -5,41 +5,194 @@ using namespace std;
|
||||
|
||||
char *source();
|
||||
|
||||
void sink(const std::string &s) {};
|
||||
void sink(const std::stringstream &s) {};
|
||||
|
||||
void test_stringstream()
|
||||
namespace ns_char
|
||||
{
|
||||
std::stringstream ss1, ss2, ss3, ss4, ss5;
|
||||
char source();
|
||||
}
|
||||
|
||||
void sink(int i) {};
|
||||
|
||||
void sink(const std::string &s) {};
|
||||
|
||||
template<class charT>
|
||||
void sink(const std::basic_ostream<charT> &s) {};
|
||||
|
||||
template<class charT>
|
||||
void sink(const std::basic_istream<charT> &s) {};
|
||||
|
||||
template<class charT>
|
||||
void sink(const std::basic_iostream<charT> &s) {};
|
||||
|
||||
void test_stringstream_string(int amount)
|
||||
{
|
||||
std::stringstream ss1, ss2, ss3, ss4, ss5, ss6, ss7, ss8, ss9, ss10, ss11, ss12, ss13;
|
||||
std::string t(source());
|
||||
|
||||
ss1 << "1234";
|
||||
ss2 << source();
|
||||
ss3 << "123" << source();
|
||||
ss4 << source() << "456";
|
||||
ss5 << t;
|
||||
sink(ss1 << "1234");
|
||||
sink(ss2 << source()); // tainted
|
||||
sink(ss3 << "123" << source()); // tainted
|
||||
sink(ss4 << source() << "456"); // tainted
|
||||
sink(ss5 << t); // tainted
|
||||
|
||||
sink(ss1);
|
||||
sink(ss2); // tainted [NOT DETECTED]
|
||||
sink(ss3); // tainted [NOT DETECTED]
|
||||
sink(ss4); // tainted [NOT DETECTED]
|
||||
sink(ss5); // tainted [NOT DETECTED]
|
||||
sink(ss2); // tainted
|
||||
sink(ss3); // tainted
|
||||
sink(ss4); // tainted
|
||||
sink(ss5); // tainted
|
||||
sink(ss1.str());
|
||||
sink(ss2.str()); // tainted [NOT DETECTED]
|
||||
sink(ss3.str()); // tainted [NOT DETECTED]
|
||||
sink(ss4.str()); // tainted [NOT DETECTED]
|
||||
sink(ss5.str()); // tainted [NOT DETECTED]
|
||||
|
||||
ss6.str("abc");
|
||||
ss6.str(source()); // (overwrites)
|
||||
ss7.str(source());
|
||||
ss7.str("abc"); // (overwrites)
|
||||
sink(ss6); // tainted [NOT DETECTED]
|
||||
sink(ss7);
|
||||
|
||||
sink(ss8.put('a'));
|
||||
sink(ss9.put(ns_char::source())); // tainted [NOT DETECTED]
|
||||
sink(ss10.put('a').put(ns_char::source()).put('z')); // tainted [NOT DETECTED]
|
||||
sink(ss8);
|
||||
sink(ss9); // tainted [NOT DETECTED]
|
||||
sink(ss10); // tainted [NOT DETECTED]
|
||||
|
||||
sink(ss11.write("begin", 5));
|
||||
sink(ss12.write(source(), 5)); // tainted [NOT DETECTED]
|
||||
sink(ss13.write("begin", 5).write(source(), amount).write("end", 3)); // tainted [NOT DETECTED]
|
||||
sink(ss11);
|
||||
sink(ss12); // tainted [NOT DETECTED]
|
||||
sink(ss13); // tainted [NOT DETECTED]
|
||||
}
|
||||
|
||||
void test_stringstream_int(int source)
|
||||
{
|
||||
std::stringstream ss1, ss2;
|
||||
int v1 = 0, v2 = 0;
|
||||
|
||||
ss1 << 1234;
|
||||
ss2 << source;
|
||||
sink(ss1 << 1234);
|
||||
sink(ss2 << source); // tainted
|
||||
sink(ss1 >> v1);
|
||||
sink(ss2 >> v2); // tainted [NOT DETECTED]
|
||||
|
||||
sink(ss1);
|
||||
sink(ss2); // tainted
|
||||
sink(ss1.str());
|
||||
sink(ss2.str()); // tainted [NOT DETECTED]
|
||||
sink(v1);
|
||||
sink(v2); // tainted [NOT DETECTED]
|
||||
}
|
||||
|
||||
void test_stringstream_constructors()
|
||||
{
|
||||
std::string s1 = "abc";
|
||||
std::string s2 = source();
|
||||
std::stringstream ss1(s1);
|
||||
std::stringstream ss2(s2);
|
||||
std::stringstream ss3 = std::stringstream("abc");
|
||||
std::stringstream ss4 = std::stringstream(source());
|
||||
std::stringstream ss5;
|
||||
std::stringstream ss6;
|
||||
|
||||
sink(ss5 = std::stringstream("abc"));
|
||||
sink(ss6 = std::stringstream(source())); // tainted [NOT DETECTED]
|
||||
|
||||
sink(ss1);
|
||||
sink(ss2); // tainted [NOT DETECTED]
|
||||
sink(ss1.str());
|
||||
sink(ss2.str()); // tainted [NOT DETECTED]
|
||||
sink(ss3);
|
||||
sink(ss4); // tainted [NOT DETECTED]
|
||||
sink(ss5);
|
||||
sink(ss6); // tainted [NOT DETECTED]
|
||||
}
|
||||
|
||||
void test_stringstream_swap()
|
||||
{
|
||||
std::stringstream ss1("abc");
|
||||
std::stringstream ss2(source());
|
||||
std::stringstream ss3("abc");
|
||||
std::stringstream ss4(source());
|
||||
|
||||
ss1.swap(ss2);
|
||||
ss4.swap(ss3);
|
||||
|
||||
sink(ss1); // tainted [NOT DETECTED]
|
||||
sink(ss2);
|
||||
sink(ss3); // tainted [NOT DETECTED]
|
||||
sink(ss4);
|
||||
}
|
||||
|
||||
void test_stringstream_in()
|
||||
{
|
||||
std::stringstream ss1, ss2;
|
||||
std::string s1, s2, s3, s4;
|
||||
char b1[100] = {0};
|
||||
char b2[100] = {0};
|
||||
char b3[100] = {0};
|
||||
char b4[100] = {0};
|
||||
char b5[100] = {0};
|
||||
char b6[100] = {0};
|
||||
char b7[100] = {0};
|
||||
char b8[100] = {0};
|
||||
char b9[100] = {0};
|
||||
char b10[100] = {0};
|
||||
char c1 = 0, c2 = 0, c3 = 0, c4 = 0, c5 = 0, c6 = 0;
|
||||
|
||||
sink(ss1 << "abc");
|
||||
sink(ss2 << source()); // tainted
|
||||
|
||||
sink(ss1 >> s1);
|
||||
sink(ss2 >> s2); // tainted [NOT DETECTED]
|
||||
sink(ss2 >> s3 >> s4); // tainted [NOT DETECTED]
|
||||
sink(s1);
|
||||
sink(s2); // tainted [NOT DETECTED]
|
||||
sink(s3); // tainted [NOT DETECTED]
|
||||
sink(s4); // tainted [NOT DETECTED]
|
||||
|
||||
sink(ss1 >> b1);
|
||||
sink(ss2 >> b2);
|
||||
sink(ss2 >> b3 >> b4);
|
||||
sink(b1);
|
||||
sink(b2); // tainted [NOT DETECTED]
|
||||
sink(b3); // tainted [NOT DETECTED]
|
||||
sink(b4); // tainted [NOT DETECTED]
|
||||
|
||||
sink(ss1.read(b5, 100));
|
||||
sink(ss2.read(b6, 100)); // tainted [NOT DETECTED]
|
||||
sink(ss1.readsome(b7, 100));
|
||||
sink(ss2.readsome(b8, 100)); // (returns a length, not significantly tainted)
|
||||
sink(ss1.get(b9, 100));
|
||||
sink(ss2.get(b10, 100));
|
||||
sink(b5);
|
||||
sink(b6); // tainted [NOT DETECTED]
|
||||
sink(b7);
|
||||
sink(b8); // tainted [NOT DETECTED]
|
||||
sink(b9);
|
||||
sink(b10); // tainted [NOT DETECTED]
|
||||
|
||||
sink(c1 = ss1.get());
|
||||
sink(c2 = ss2.get()); // tainted [NOT DETECTED]
|
||||
sink(c3 = ss1.peek());
|
||||
sink(c4 = ss2.peek()); // tainted [NOT DETECTED]
|
||||
sink(ss1.get(c5));
|
||||
sink(ss2.get(c6)); // tainted [NOT DETECTED]
|
||||
sink(c1);
|
||||
sink(c2); // tainted [NOT DETECTED]
|
||||
sink(c3);
|
||||
sink(c4); // tainted [NOT DETECTED]
|
||||
sink(c5);
|
||||
sink(c6); // tainted [NOT DETECTED]
|
||||
}
|
||||
|
||||
void test_stringstream_putback()
|
||||
{
|
||||
std::stringstream ss;
|
||||
|
||||
sink(ss.put('a'));
|
||||
sink(ss.get());
|
||||
sink(ss.putback('b'));
|
||||
sink(ss.get());
|
||||
sink(ss.putback(ns_char::source())); // tainted [NOT DETECTED]
|
||||
sink(ss.get()); // tainted [NOT DETECTED]
|
||||
}
|
||||
|
||||
@@ -37,6 +37,12 @@
|
||||
| movableclass.cpp:55:8:55:9 | s2 | movableclass.cpp:52:23:52:28 | call to source |
|
||||
| movableclass.cpp:64:8:64:9 | s2 | movableclass.cpp:23:55:23:60 | call to source |
|
||||
| movableclass.cpp:65:11:65:11 | call to operator= | movableclass.cpp:65:13:65:18 | call to source |
|
||||
| smart_pointer.cpp:12:10:12:10 | call to operator* | smart_pointer.cpp:11:52:11:57 | call to source |
|
||||
| smart_pointer.cpp:13:10:13:10 | p | smart_pointer.cpp:11:52:11:57 | call to source |
|
||||
| smart_pointer.cpp:24:10:24:10 | call to operator* | smart_pointer.cpp:23:52:23:57 | call to source |
|
||||
| smart_pointer.cpp:25:10:25:10 | p | smart_pointer.cpp:23:52:23:57 | call to source |
|
||||
| smart_pointer.cpp:52:12:52:14 | call to get | smart_pointer.cpp:51:52:51:57 | call to source |
|
||||
| smart_pointer.cpp:57:12:57:14 | call to get | smart_pointer.cpp:56:52:56:57 | call to source |
|
||||
| standalone_iterators.cpp:40:10:40:10 | call to operator* | standalone_iterators.cpp:39:45:39:51 | source1 |
|
||||
| standalone_iterators.cpp:41:10:41:10 | call to operator* | standalone_iterators.cpp:39:45:39:51 | source1 |
|
||||
| standalone_iterators.cpp:42:10:42:10 | call to operator* | standalone_iterators.cpp:39:45:39:51 | source1 |
|
||||
@@ -156,6 +162,17 @@
|
||||
| string.cpp:555:8:555:8 | d | string.cpp:549:27:549:32 | call to source |
|
||||
| string.cpp:556:8:556:8 | e | string.cpp:550:31:550:36 | call to source |
|
||||
| string.cpp:557:8:557:8 | f | string.cpp:551:18:551:23 | call to source |
|
||||
| stringstream.cpp:32:11:32:11 | call to operator<< | stringstream.cpp:32:14:32:19 | call to source |
|
||||
| stringstream.cpp:33:20:33:20 | call to operator<< | stringstream.cpp:33:23:33:28 | call to source |
|
||||
| stringstream.cpp:34:23:34:23 | call to operator<< | stringstream.cpp:34:14:34:19 | call to source |
|
||||
| stringstream.cpp:35:11:35:11 | call to operator<< | stringstream.cpp:29:16:29:21 | call to source |
|
||||
| stringstream.cpp:38:7:38:9 | ss2 | stringstream.cpp:32:14:32:19 | call to source |
|
||||
| stringstream.cpp:39:7:39:9 | ss3 | stringstream.cpp:33:23:33:28 | call to source |
|
||||
| stringstream.cpp:40:7:40:9 | ss4 | stringstream.cpp:34:14:34:19 | call to source |
|
||||
| stringstream.cpp:41:7:41:9 | ss5 | stringstream.cpp:29:16:29:21 | call to source |
|
||||
| stringstream.cpp:76:11:76:11 | call to operator<< | stringstream.cpp:70:32:70:37 | source |
|
||||
| stringstream.cpp:81:7:81:9 | ss2 | stringstream.cpp:70:32:70:37 | source |
|
||||
| stringstream.cpp:143:11:143:11 | call to operator<< | stringstream.cpp:143:14:143:19 | call to source |
|
||||
| structlikeclass.cpp:35:8:35:9 | s1 | structlikeclass.cpp:29:22:29:27 | call to source |
|
||||
| structlikeclass.cpp:36:8:36:9 | s2 | structlikeclass.cpp:30:24:30:29 | call to source |
|
||||
| structlikeclass.cpp:37:8:37:9 | s3 | structlikeclass.cpp:29:22:29:27 | call to source |
|
||||
|
||||
@@ -48,6 +48,12 @@
|
||||
| movableclass.cpp:55:8:55:9 | movableclass.cpp:52:23:52:28 | AST only |
|
||||
| movableclass.cpp:64:8:64:9 | movableclass.cpp:23:55:23:60 | AST only |
|
||||
| movableclass.cpp:65:11:65:11 | movableclass.cpp:65:13:65:18 | AST only |
|
||||
| smart_pointer.cpp:12:10:12:10 | smart_pointer.cpp:11:52:11:57 | AST only |
|
||||
| smart_pointer.cpp:13:10:13:10 | smart_pointer.cpp:11:52:11:57 | AST only |
|
||||
| smart_pointer.cpp:24:10:24:10 | smart_pointer.cpp:23:52:23:57 | AST only |
|
||||
| smart_pointer.cpp:25:10:25:10 | smart_pointer.cpp:23:52:23:57 | AST only |
|
||||
| smart_pointer.cpp:52:12:52:14 | smart_pointer.cpp:51:52:51:57 | AST only |
|
||||
| smart_pointer.cpp:57:12:57:14 | smart_pointer.cpp:56:52:56:57 | AST only |
|
||||
| standalone_iterators.cpp:40:10:40:10 | standalone_iterators.cpp:39:45:39:51 | AST only |
|
||||
| standalone_iterators.cpp:41:10:41:10 | standalone_iterators.cpp:39:45:39:51 | AST only |
|
||||
| standalone_iterators.cpp:42:10:42:10 | standalone_iterators.cpp:39:45:39:51 | AST only |
|
||||
@@ -166,6 +172,25 @@
|
||||
| string.cpp:555:8:555:8 | string.cpp:549:27:549:32 | AST only |
|
||||
| string.cpp:556:8:556:8 | string.cpp:550:31:550:36 | AST only |
|
||||
| string.cpp:557:8:557:8 | string.cpp:551:18:551:23 | AST only |
|
||||
| stringstream.cpp:32:11:32:11 | stringstream.cpp:32:14:32:21 | IR only |
|
||||
| stringstream.cpp:32:11:32:22 | stringstream.cpp:32:14:32:19 | IR only |
|
||||
| stringstream.cpp:32:11:32:22 | stringstream.cpp:32:14:32:21 | IR only |
|
||||
| stringstream.cpp:33:20:33:20 | stringstream.cpp:33:23:33:30 | IR only |
|
||||
| stringstream.cpp:33:20:33:31 | stringstream.cpp:33:23:33:28 | IR only |
|
||||
| stringstream.cpp:33:20:33:31 | stringstream.cpp:33:23:33:30 | IR only |
|
||||
| stringstream.cpp:34:23:34:23 | stringstream.cpp:34:14:34:21 | IR only |
|
||||
| stringstream.cpp:34:23:34:31 | stringstream.cpp:34:14:34:19 | IR only |
|
||||
| stringstream.cpp:34:23:34:31 | stringstream.cpp:34:14:34:21 | IR only |
|
||||
| stringstream.cpp:35:11:35:11 | stringstream.cpp:29:16:29:21 | AST only |
|
||||
| stringstream.cpp:38:7:38:9 | stringstream.cpp:32:14:32:19 | AST only |
|
||||
| stringstream.cpp:39:7:39:9 | stringstream.cpp:33:23:33:28 | AST only |
|
||||
| stringstream.cpp:40:7:40:9 | stringstream.cpp:34:14:34:19 | AST only |
|
||||
| stringstream.cpp:41:7:41:9 | stringstream.cpp:29:16:29:21 | AST only |
|
||||
| stringstream.cpp:76:11:76:11 | stringstream.cpp:70:32:70:37 | AST only |
|
||||
| stringstream.cpp:81:7:81:9 | stringstream.cpp:70:32:70:37 | AST only |
|
||||
| stringstream.cpp:143:11:143:11 | stringstream.cpp:143:14:143:21 | IR only |
|
||||
| stringstream.cpp:143:11:143:22 | stringstream.cpp:143:14:143:19 | IR only |
|
||||
| stringstream.cpp:143:11:143:22 | stringstream.cpp:143:14:143:21 | IR only |
|
||||
| structlikeclass.cpp:35:8:35:9 | structlikeclass.cpp:29:22:29:27 | AST only |
|
||||
| structlikeclass.cpp:36:8:36:9 | structlikeclass.cpp:30:24:30:29 | AST only |
|
||||
| structlikeclass.cpp:37:8:37:9 | structlikeclass.cpp:29:22:29:27 | AST only |
|
||||
|
||||
@@ -24,6 +24,38 @@
|
||||
| string.cpp:28:7:28:7 | a | string.cpp:24:12:24:17 | call to source |
|
||||
| string.cpp:55:7:55:8 | cs | string.cpp:50:19:50:24 | call to source |
|
||||
| string.cpp:55:7:55:8 | cs | string.cpp:50:19:50:26 | (const char *)... |
|
||||
| stringstream.cpp:32:11:32:11 | call to operator<< | stringstream.cpp:32:14:32:19 | call to source |
|
||||
| stringstream.cpp:32:11:32:11 | call to operator<< | stringstream.cpp:32:14:32:21 | (const char *)... |
|
||||
| stringstream.cpp:32:11:32:22 | (const basic_ostream<char, char_traits<char>>)... | stringstream.cpp:32:14:32:19 | call to source |
|
||||
| stringstream.cpp:32:11:32:22 | (const basic_ostream<char, char_traits<char>>)... | stringstream.cpp:32:14:32:21 | (const char *)... |
|
||||
| stringstream.cpp:32:11:32:22 | (reference dereference) | stringstream.cpp:32:14:32:19 | call to source |
|
||||
| stringstream.cpp:32:11:32:22 | (reference dereference) | stringstream.cpp:32:14:32:21 | (const char *)... |
|
||||
| stringstream.cpp:32:11:32:22 | (reference to) | stringstream.cpp:32:14:32:19 | call to source |
|
||||
| stringstream.cpp:32:11:32:22 | (reference to) | stringstream.cpp:32:14:32:21 | (const char *)... |
|
||||
| stringstream.cpp:33:20:33:20 | call to operator<< | stringstream.cpp:33:23:33:28 | call to source |
|
||||
| stringstream.cpp:33:20:33:20 | call to operator<< | stringstream.cpp:33:23:33:30 | (const char *)... |
|
||||
| stringstream.cpp:33:20:33:31 | (const basic_ostream<char, char_traits<char>>)... | stringstream.cpp:33:23:33:28 | call to source |
|
||||
| stringstream.cpp:33:20:33:31 | (const basic_ostream<char, char_traits<char>>)... | stringstream.cpp:33:23:33:30 | (const char *)... |
|
||||
| stringstream.cpp:33:20:33:31 | (reference dereference) | stringstream.cpp:33:23:33:28 | call to source |
|
||||
| stringstream.cpp:33:20:33:31 | (reference dereference) | stringstream.cpp:33:23:33:30 | (const char *)... |
|
||||
| stringstream.cpp:33:20:33:31 | (reference to) | stringstream.cpp:33:23:33:28 | call to source |
|
||||
| stringstream.cpp:33:20:33:31 | (reference to) | stringstream.cpp:33:23:33:30 | (const char *)... |
|
||||
| stringstream.cpp:34:23:34:23 | call to operator<< | stringstream.cpp:34:14:34:19 | call to source |
|
||||
| stringstream.cpp:34:23:34:23 | call to operator<< | stringstream.cpp:34:14:34:21 | (const char *)... |
|
||||
| stringstream.cpp:34:23:34:31 | (const basic_ostream<char, char_traits<char>>)... | stringstream.cpp:34:14:34:19 | call to source |
|
||||
| stringstream.cpp:34:23:34:31 | (const basic_ostream<char, char_traits<char>>)... | stringstream.cpp:34:14:34:21 | (const char *)... |
|
||||
| stringstream.cpp:34:23:34:31 | (reference dereference) | stringstream.cpp:34:14:34:19 | call to source |
|
||||
| stringstream.cpp:34:23:34:31 | (reference dereference) | stringstream.cpp:34:14:34:21 | (const char *)... |
|
||||
| stringstream.cpp:34:23:34:31 | (reference to) | stringstream.cpp:34:14:34:19 | call to source |
|
||||
| stringstream.cpp:34:23:34:31 | (reference to) | stringstream.cpp:34:14:34:21 | (const char *)... |
|
||||
| stringstream.cpp:143:11:143:11 | call to operator<< | stringstream.cpp:143:14:143:19 | call to source |
|
||||
| stringstream.cpp:143:11:143:11 | call to operator<< | stringstream.cpp:143:14:143:21 | (const char *)... |
|
||||
| stringstream.cpp:143:11:143:22 | (const basic_ostream<char, char_traits<char>>)... | stringstream.cpp:143:14:143:19 | call to source |
|
||||
| stringstream.cpp:143:11:143:22 | (const basic_ostream<char, char_traits<char>>)... | stringstream.cpp:143:14:143:21 | (const char *)... |
|
||||
| stringstream.cpp:143:11:143:22 | (reference dereference) | stringstream.cpp:143:14:143:19 | call to source |
|
||||
| stringstream.cpp:143:11:143:22 | (reference dereference) | stringstream.cpp:143:14:143:21 | (const char *)... |
|
||||
| stringstream.cpp:143:11:143:22 | (reference to) | stringstream.cpp:143:14:143:19 | call to source |
|
||||
| stringstream.cpp:143:11:143:22 | (reference to) | stringstream.cpp:143:14:143:21 | (const char *)... |
|
||||
| structlikeclass.cpp:38:8:38:9 | s4 | structlikeclass.cpp:33:8:33:13 | call to source |
|
||||
| structlikeclass.cpp:61:8:61:9 | s2 | structlikeclass.cpp:58:24:58:29 | call to source |
|
||||
| structlikeclass.cpp:62:8:62:20 | ... = ... | structlikeclass.cpp:62:13:62:18 | call to source |
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
import cpp
|
||||
|
||||
from Block b, MacroAccess m
|
||||
from BlockStmt b, MacroAccess m
|
||||
where affectedbymacroexpansion(unresolveElement(b), unresolveElement(m))
|
||||
select b, m
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import cpp
|
||||
|
||||
from Block b, MacroAccess m
|
||||
from BlockStmt b, MacroAccess m
|
||||
where inmacroexpansion(unresolveElement(b), unresolveElement(m))
|
||||
select b, m
|
||||
|
||||
@@ -540,7 +540,7 @@
|
||||
| test.c:548:9:548:9 | n | 0 |
|
||||
| test.c:551:8:551:8 | n | 0 |
|
||||
| test.c:552:9:552:9 | n | 0 |
|
||||
| test.c:554:9:554:9 | n | 0 |
|
||||
| test.c:554:9:554:9 | n | 1 |
|
||||
| test.c:557:10:557:10 | n | 0 |
|
||||
| test.c:558:5:558:5 | n | 1 |
|
||||
| test.c:561:7:561:7 | n | 0 |
|
||||
@@ -549,7 +549,7 @@
|
||||
| test.c:569:9:569:9 | n | 0 |
|
||||
| test.c:571:9:571:9 | n | 1 |
|
||||
| test.c:574:7:574:7 | n | 0 |
|
||||
| test.c:575:9:575:9 | n | 0 |
|
||||
| test.c:575:9:575:9 | n | 1 |
|
||||
| test.c:577:9:577:9 | n | 0 |
|
||||
| test.c:580:10:580:10 | n | 0 |
|
||||
| test.c:581:5:581:5 | n | 1 |
|
||||
@@ -563,6 +563,25 @@
|
||||
| test.c:601:7:601:7 | n | -32768 |
|
||||
| test.c:601:22:601:22 | n | -32767 |
|
||||
| test.c:602:9:602:9 | n | -32766 |
|
||||
| test.c:605:7:605:7 | n | -32768 |
|
||||
| test.c:606:5:606:5 | n | 0 |
|
||||
| test.c:606:10:606:10 | n | 1 |
|
||||
| test.c:606:14:606:14 | n | 0 |
|
||||
| test.c:607:6:607:6 | n | 0 |
|
||||
| test.c:607:10:607:10 | n | 0 |
|
||||
| test.c:607:14:607:14 | n | 1 |
|
||||
| test.c:618:7:618:8 | ss | -32768 |
|
||||
| test.c:619:9:619:10 | ss | 0 |
|
||||
| test.c:622:7:622:8 | ss | -32768 |
|
||||
| test.c:623:9:623:10 | ss | -32768 |
|
||||
| test.c:626:14:626:15 | us | 0 |
|
||||
| test.c:627:9:627:10 | us | 0 |
|
||||
| test.c:630:14:630:15 | us | 0 |
|
||||
| test.c:631:9:631:10 | us | 0 |
|
||||
| test.c:634:7:634:8 | ss | -32768 |
|
||||
| test.c:635:9:635:10 | ss | -32768 |
|
||||
| test.c:638:7:638:8 | ss | -32768 |
|
||||
| test.c:639:9:639:10 | ss | -1 |
|
||||
| test.cpp:10:7:10:7 | b | -2147483648 |
|
||||
| test.cpp:11:5:11:5 | x | -2147483648 |
|
||||
| test.cpp:13:10:13:10 | x | -2147483648 |
|
||||
@@ -616,3 +635,16 @@
|
||||
| test.cpp:97:10:97:10 | i | -2147483648 |
|
||||
| test.cpp:97:22:97:22 | i | -2147483648 |
|
||||
| test.cpp:98:5:98:5 | i | -2147483648 |
|
||||
| test.cpp:105:7:105:7 | n | -32768 |
|
||||
| test.cpp:108:7:108:7 | n | 0 |
|
||||
| test.cpp:109:5:109:5 | n | 1 |
|
||||
| test.cpp:111:5:111:5 | n | 0 |
|
||||
| test.cpp:114:8:114:8 | n | 0 |
|
||||
| test.cpp:115:5:115:5 | n | 0 |
|
||||
| test.cpp:117:5:117:5 | n | 1 |
|
||||
| test.cpp:120:3:120:3 | n | 0 |
|
||||
| test.cpp:120:8:120:8 | n | 1 |
|
||||
| test.cpp:120:12:120:12 | n | 0 |
|
||||
| test.cpp:121:4:121:4 | n | 0 |
|
||||
| test.cpp:121:8:121:8 | n | 0 |
|
||||
| test.cpp:121:12:121:12 | n | 1 |
|
||||
|
||||
@@ -13,3 +13,7 @@
|
||||
| test.c:386:10:386:21 | ... ? ... : ... | 100.0 | 100.0 | 5.0 |
|
||||
| test.c:387:10:387:38 | ... ? ... : ... | 0.0 | 100.0 | 5.0 |
|
||||
| test.c:394:20:394:36 | ... ? ... : ... | 0.0 | 0.0 | 100.0 |
|
||||
| test.c:606:5:606:14 | ... ? ... : ... | 0.0 | 1.0 | 0.0 |
|
||||
| test.c:607:5:607:14 | ... ? ... : ... | 0.0 | 0.0 | 1.0 |
|
||||
| test.cpp:120:3:120:12 | ... ? ... : ... | 0.0 | 1.0 | 0.0 |
|
||||
| test.cpp:121:3:121:12 | ... ? ... : ... | 0.0 | 0.0 | 1.0 |
|
||||
|
||||
@@ -13,3 +13,7 @@
|
||||
| test.c:386:10:386:21 | ... ? ... : ... | 4.294967295E9 | 4.294967295E9 | 5.0 |
|
||||
| test.c:387:10:387:38 | ... ? ... : ... | 255.0 | 4.294967295E9 | 5.0 |
|
||||
| test.c:394:20:394:36 | ... ? ... : ... | 100.0 | 99.0 | 100.0 |
|
||||
| test.c:606:5:606:14 | ... ? ... : ... | 32767.0 | 32767.0 | 0.0 |
|
||||
| test.c:607:5:607:14 | ... ? ... : ... | 32767.0 | 0.0 | 32767.0 |
|
||||
| test.cpp:120:3:120:12 | ... ? ... : ... | 32767.0 | 32767.0 | 0.0 |
|
||||
| test.cpp:121:3:121:12 | ... ? ... : ... | 32767.0 | 0.0 | 32767.0 |
|
||||
|
||||
@@ -551,7 +551,7 @@ int notequal_type_endpoint(unsigned n) {
|
||||
if (!n) {
|
||||
out(n); // 0 .. 0
|
||||
} else {
|
||||
out(n); // 1 .. [BUG: lower bound is deduced to be 0]
|
||||
out(n); // 1 ..
|
||||
}
|
||||
|
||||
while (n != 0) {
|
||||
@@ -572,7 +572,7 @@ void notequal_refinement(short n) {
|
||||
}
|
||||
|
||||
if (n) {
|
||||
out(n); // 1 .. [BUG: lower bound is deduced to be 0]
|
||||
out(n); // 1 ..
|
||||
} else {
|
||||
out(n); // 0 .. 0
|
||||
}
|
||||
@@ -601,4 +601,41 @@ void notequal_variations(short n, float f) {
|
||||
if (n != -32768 && n != -32767) {
|
||||
out(n); // -32766 ..
|
||||
}
|
||||
|
||||
if (n >= 0) {
|
||||
n ? n : n; // ? 1.. : 0..0
|
||||
!n ? n : n; // ? 0..0 : 1..
|
||||
}
|
||||
}
|
||||
|
||||
void two_bounds_from_one_test(short ss, unsigned short us) {
|
||||
// These tests demonstrate how the range analysis is often able to deduce
|
||||
// both an upper bound and a lower bound even when there is only one
|
||||
// inequality in the source. For example `signedInt < 4U` establishes that
|
||||
// `signedInt >= 0` since if `signedInt` were negative then it would be
|
||||
// greater than 4 in the unsigned comparison.
|
||||
|
||||
if (ss < sizeof(int)) { // Lower bound added in `linearBoundFromGuard`
|
||||
out(ss); // 0 .. 3
|
||||
}
|
||||
|
||||
if (ss < 0x8001) { // Lower bound removed in `getDefLowerBounds`
|
||||
out(ss); // -32768 .. 32767
|
||||
}
|
||||
|
||||
if ((short)us >= 0) {
|
||||
out(us); // 0 .. 32767
|
||||
}
|
||||
|
||||
if ((short)us >= -1) {
|
||||
out(us); // 0 .. 65535
|
||||
}
|
||||
|
||||
if (ss >= sizeof(int)) { // test is true for negative numbers
|
||||
out(ss); // -32768 .. 32767
|
||||
}
|
||||
|
||||
if (ss + 1 < sizeof(int)) {
|
||||
out(ss); // -1 .. 2
|
||||
}
|
||||
}
|
||||
@@ -100,3 +100,23 @@ int ref_to_number(int &i, const int &ci, int &aliased) {
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void notequal_refinement(short n) {
|
||||
if (n < 0)
|
||||
return;
|
||||
|
||||
if (n) {
|
||||
n; // 1 ..
|
||||
} else {
|
||||
n; // 0 .. 0
|
||||
}
|
||||
|
||||
if (!n) {
|
||||
n; // 0 .. 0
|
||||
} else {
|
||||
n; // 1 ..
|
||||
}
|
||||
|
||||
n ? n : n; // ? 1.. : 0..0
|
||||
!n ? n : n; // ? 0..0 : 1..
|
||||
}
|
||||
|
||||
@@ -539,7 +539,7 @@
|
||||
| test.c:546:9:546:9 | n | 4294967295 |
|
||||
| test.c:548:9:548:9 | n | 0 |
|
||||
| test.c:551:8:551:8 | n | 4294967295 |
|
||||
| test.c:552:9:552:9 | n | 4294967295 |
|
||||
| test.c:552:9:552:9 | n | 0 |
|
||||
| test.c:554:9:554:9 | n | 4294967295 |
|
||||
| test.c:557:10:557:10 | n | 4294967295 |
|
||||
| test.c:558:5:558:5 | n | 4294967295 |
|
||||
@@ -550,7 +550,7 @@
|
||||
| test.c:571:9:571:9 | n | 32767 |
|
||||
| test.c:574:7:574:7 | n | 32767 |
|
||||
| test.c:575:9:575:9 | n | 32767 |
|
||||
| test.c:577:9:577:9 | n | 32767 |
|
||||
| test.c:577:9:577:9 | n | 0 |
|
||||
| test.c:580:10:580:10 | n | 32767 |
|
||||
| test.c:581:5:581:5 | n | 32767 |
|
||||
| test.c:584:7:584:7 | n | 0 |
|
||||
@@ -563,6 +563,25 @@
|
||||
| test.c:601:7:601:7 | n | 32767 |
|
||||
| test.c:601:22:601:22 | n | 32767 |
|
||||
| test.c:602:9:602:9 | n | 32767 |
|
||||
| test.c:605:7:605:7 | n | 32767 |
|
||||
| test.c:606:5:606:5 | n | 32767 |
|
||||
| test.c:606:10:606:10 | n | 32767 |
|
||||
| test.c:606:14:606:14 | n | 0 |
|
||||
| test.c:607:6:607:6 | n | 32767 |
|
||||
| test.c:607:10:607:10 | n | 0 |
|
||||
| test.c:607:14:607:14 | n | 32767 |
|
||||
| test.c:618:7:618:8 | ss | 32767 |
|
||||
| test.c:619:9:619:10 | ss | 3 |
|
||||
| test.c:622:7:622:8 | ss | 32767 |
|
||||
| test.c:623:9:623:10 | ss | 32767 |
|
||||
| test.c:626:14:626:15 | us | 65535 |
|
||||
| test.c:627:9:627:10 | us | 32767 |
|
||||
| test.c:630:14:630:15 | us | 65535 |
|
||||
| test.c:631:9:631:10 | us | 65535 |
|
||||
| test.c:634:7:634:8 | ss | 32767 |
|
||||
| test.c:635:9:635:10 | ss | 32767 |
|
||||
| test.c:638:7:638:8 | ss | 32767 |
|
||||
| test.c:639:9:639:10 | ss | 2 |
|
||||
| test.cpp:10:7:10:7 | b | 2147483647 |
|
||||
| test.cpp:11:5:11:5 | x | 2147483647 |
|
||||
| test.cpp:13:10:13:10 | x | 2147483647 |
|
||||
@@ -616,3 +635,16 @@
|
||||
| test.cpp:97:10:97:10 | i | 65535 |
|
||||
| test.cpp:97:22:97:22 | i | 32767 |
|
||||
| test.cpp:98:5:98:5 | i | 32767 |
|
||||
| test.cpp:105:7:105:7 | n | 32767 |
|
||||
| test.cpp:108:7:108:7 | n | 32767 |
|
||||
| test.cpp:109:5:109:5 | n | 32767 |
|
||||
| test.cpp:111:5:111:5 | n | 0 |
|
||||
| test.cpp:114:8:114:8 | n | 32767 |
|
||||
| test.cpp:115:5:115:5 | n | 0 |
|
||||
| test.cpp:117:5:117:5 | n | 32767 |
|
||||
| test.cpp:120:3:120:3 | n | 32767 |
|
||||
| test.cpp:120:8:120:8 | n | 32767 |
|
||||
| test.cpp:120:12:120:12 | n | 0 |
|
||||
| test.cpp:121:4:121:4 | n | 32767 |
|
||||
| test.cpp:121:8:121:8 | n | 0 |
|
||||
| test.cpp:121:12:121:12 | n | 32767 |
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import cpp
|
||||
|
||||
from Function f, Block b
|
||||
from Function f, BlockStmt b
|
||||
where b = f.getEntryPoint()
|
||||
select f, b, b.getAStmt()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import cpp
|
||||
|
||||
from Function f1, Block body, Declaration d
|
||||
from Function f1, BlockStmt body, Declaration d
|
||||
where
|
||||
body = f1.getBlock() and
|
||||
d = body.getADeclaration()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import cpp
|
||||
|
||||
from Block b, int i
|
||||
from BlockStmt b, int i
|
||||
select b, i, b.getStmt(i)
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
| test.c:33:3:33:19 | call to not_yet_declared2 | Calling $@: argument $@ of type $@ is incompatible with parameter $@. | test.c:32:3:32:3 | not_yet_declared2 | not_yet_declared2 | test.c:33:21:33:22 | ca | ca | file://:0:0:0:0 | int * | int * | test.c:76:24:76:26 | p#0 | int p#0 |
|
||||
| test.c:33:3:33:19 | call to not_yet_declared2 | Calling $@: argument $@ of type $@ is incompatible with parameter $@. | test.c:32:3:32:3 | not_yet_declared2 | not_yet_declared2 | test.c:33:21:33:22 | ca | ca | file://:0:0:0:0 | int[4] | int[4] | test.c:76:24:76:26 | p#0 | int p#0 |
|
||||
| test.c:33:3:33:19 | call to not_yet_declared2 | Calling $@: argument $@ of type $@ is incompatible with parameter $@. | test.c:76:6:76:22 | not_yet_declared2 | not_yet_declared2 | test.c:33:21:33:22 | ca | ca | file://:0:0:0:0 | int * | int * | test.c:76:24:76:26 | p#0 | int p#0 |
|
||||
| test.c:33:3:33:19 | call to not_yet_declared2 | Calling $@: argument $@ of type $@ is incompatible with parameter $@. | test.c:76:6:76:22 | not_yet_declared2 | not_yet_declared2 | test.c:33:21:33:22 | ca | ca | file://:0:0:0:0 | int[4] | int[4] | test.c:76:24:76:26 | p#0 | int p#0 |
|
||||
| test.c:40:3:40:29 | call to declared_empty_defined_with | Calling $@: argument $@ of type $@ is incompatible with parameter $@. | test.c:77:6:77:32 | declared_empty_defined_with | declared_empty_defined_with | test.c:40:31:40:32 | & ... | & ... | file://:0:0:0:0 | int * | int * | test.c:77:38:77:38 | x | int x |
|
||||
| test.c:44:3:44:27 | call to not_declared_defined_with | Calling $@: argument $@ of type $@ is incompatible with parameter $@. | test.c:80:6:80:30 | not_declared_defined_with | not_declared_defined_with | test.c:44:29:44:31 | 4 | 4 | file://:0:0:0:0 | long long | long long | test.c:80:36:80:36 | x | int x |
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import cpp
|
||||
|
||||
from Block s, int i, Stmt f, boolean succ
|
||||
from BlockStmt s, int i, Stmt f, boolean succ
|
||||
where
|
||||
s.getParentStmt().hasChild(s, i) and
|
||||
s.getParentStmt().hasChild(f, i + 1) and
|
||||
|
||||
@@ -8,7 +8,7 @@ import cpp
|
||||
from DoStmt ds, ExprStmt last, Expr succ
|
||||
where
|
||||
ds.getEnclosingFunction().hasName("normal") and
|
||||
last = ds.getStmt().(Block).getLastStmt() and
|
||||
last = ds.getStmt().(BlockStmt).getLastStmt() and
|
||||
succ = last.getExpr().getASuccessor() and
|
||||
succ = ds.getCondition().getAChild*() and
|
||||
count(last.getExpr().getASuccessor()) = 1
|
||||
|
||||
@@ -9,7 +9,7 @@ import cpp
|
||||
from ForStmt fs, ExprStmt last, Expr succ
|
||||
where
|
||||
fs.getEnclosingFunction().hasName("normal") and
|
||||
last = fs.getStmt().(Block).getLastStmt() and
|
||||
last = fs.getStmt().(BlockStmt).getLastStmt() and
|
||||
succ = fs.getCondition().getAChild*() and
|
||||
succ = last.getExpr().getASuccessor() and
|
||||
count(last.getExpr().getASuccessor()) = 1
|
||||
|
||||
@@ -10,7 +10,7 @@ where
|
||||
is.getEnclosingFunction().hasName("normal") and
|
||||
is.getParentStmt().hasChild(is, k) and
|
||||
is.getParentStmt().hasChild(l3, k + 1) and
|
||||
last = is.getThen().(Block).getLastStmt() and
|
||||
last = is.getThen().(BlockStmt).getLastStmt() and
|
||||
l3 = last.getASuccessor() and
|
||||
count(last.getASuccessor()) = 1
|
||||
select last, l3.getName()
|
||||
|
||||
@@ -10,7 +10,7 @@ where
|
||||
is.getEnclosingFunction().hasName("normal") and
|
||||
is.getParentStmt().hasChild(is, k) and
|
||||
is.getParentStmt().hasChild(l3, k + 1) and
|
||||
last = is.getElse().(Block).getLastStmt() and
|
||||
last = is.getElse().(BlockStmt).getLastStmt() and
|
||||
l3 = last.getASuccessor() and
|
||||
count(last.getASuccessor()) = 1
|
||||
select last, l3.getName()
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import cpp
|
||||
|
||||
from IfStmt is, Block t
|
||||
from IfStmt is, BlockStmt t
|
||||
where
|
||||
is.getEnclosingFunction().hasName("normal") and
|
||||
t = is.getThen() and
|
||||
|
||||
@@ -10,7 +10,7 @@ where
|
||||
is.getEnclosingFunction().hasName("normal") and
|
||||
is.getParentStmt().hasChild(is, k) and
|
||||
is.getParentStmt().hasChild(l2, k + 1) and
|
||||
last = is.getThen().(Block).getLastStmt() and
|
||||
last = is.getThen().(BlockStmt).getLastStmt() and
|
||||
l2 = last.getASuccessor() and
|
||||
count(last.getASuccessor()) = 1
|
||||
select last, l2.getName()
|
||||
|
||||
@@ -8,7 +8,7 @@ import cpp
|
||||
from WhileStmt ws, ExprStmt last, Expr succ
|
||||
where
|
||||
ws.getEnclosingFunction().hasName("normal") and
|
||||
last = ws.getStmt().(Block).getLastStmt() and
|
||||
last = ws.getStmt().(BlockStmt).getLastStmt() and
|
||||
succ = last.getExpr().getASuccessor() and
|
||||
succ = ws.getCondition().getAChild*() and
|
||||
count(last.getExpr().getASuccessor()) = 1
|
||||
|
||||
@@ -5,6 +5,7 @@ using System;
|
||||
using System.Linq;
|
||||
using Microsoft.Build.Construction;
|
||||
using System.Xml;
|
||||
using System.IO;
|
||||
|
||||
namespace Semmle.Autobuild.CSharp.Tests
|
||||
{
|
||||
@@ -34,7 +35,7 @@ namespace Semmle.Autobuild.CSharp.Tests
|
||||
FileExistsIn.Add(file);
|
||||
if (FileExists.TryGetValue(file, out var ret))
|
||||
return ret;
|
||||
if (FileExists.TryGetValue(System.IO.Path.GetFileName(file), out ret))
|
||||
if (FileExists.TryGetValue(Path.GetFileName(file), out ret))
|
||||
return ret;
|
||||
throw new ArgumentException("Missing FileExists " + file);
|
||||
}
|
||||
@@ -43,6 +44,8 @@ namespace Semmle.Autobuild.CSharp.Tests
|
||||
public readonly IDictionary<string, int> RunProcess = new Dictionary<string, int>();
|
||||
public readonly IDictionary<string, string> RunProcessOut = new Dictionary<string, string>();
|
||||
public readonly IDictionary<string, string> RunProcessWorkingDirectory = new Dictionary<string, string>();
|
||||
public readonly HashSet<string> CreateDirectories = new HashSet<string>();
|
||||
public readonly HashSet<(string, string)> DownloadFiles = new HashSet<(string, string)>();
|
||||
|
||||
int IBuildActions.RunProcess(string cmd, string args, string? workingDirectory, IDictionary<string, string>? env, out IList<string> stdOut)
|
||||
{
|
||||
@@ -109,7 +112,7 @@ namespace Semmle.Autobuild.CSharp.Tests
|
||||
IEnumerable<string> IBuildActions.EnumerateFiles(string dir)
|
||||
{
|
||||
if (EnumerateFiles.TryGetValue(dir, out var str))
|
||||
return str.Split("\n");
|
||||
return str.Split("\n").Select(p => PathCombine(dir, p));
|
||||
throw new ArgumentException("Missing EnumerateFiles " + dir);
|
||||
}
|
||||
|
||||
@@ -118,7 +121,7 @@ namespace Semmle.Autobuild.CSharp.Tests
|
||||
IEnumerable<string> IBuildActions.EnumerateDirectories(string dir)
|
||||
{
|
||||
if (EnumerateDirectories.TryGetValue(dir, out var str))
|
||||
return string.IsNullOrEmpty(str) ? Enumerable.Empty<string>() : str.Split("\n");
|
||||
return string.IsNullOrEmpty(str) ? Enumerable.Empty<string>() : str.Split("\n").Select(p => PathCombine(dir, p));
|
||||
throw new ArgumentException("Missing EnumerateDirectories " + dir);
|
||||
}
|
||||
|
||||
@@ -126,13 +129,21 @@ namespace Semmle.Autobuild.CSharp.Tests
|
||||
|
||||
bool IBuildActions.IsWindows() => IsWindows;
|
||||
|
||||
string IBuildActions.PathCombine(params string[] parts)
|
||||
public string PathCombine(params string[] parts)
|
||||
{
|
||||
return string.Join(IsWindows ? '\\' : '/', parts.Where(p => !string.IsNullOrWhiteSpace(p)));
|
||||
}
|
||||
|
||||
string IBuildActions.GetFullPath(string path) => path;
|
||||
|
||||
string? IBuildActions.GetFileName(string? path) => Path.GetFileName(path?.Replace('\\', '/'));
|
||||
|
||||
public string? GetDirectoryName(string? path)
|
||||
{
|
||||
var dir = Path.GetDirectoryName(path?.Replace('\\', '/'));
|
||||
return dir is null ? path : path?.Substring(0, dir.Length);
|
||||
}
|
||||
|
||||
void IBuildActions.WriteAllText(string filename, string contents)
|
||||
{
|
||||
}
|
||||
@@ -152,6 +163,18 @@ namespace Semmle.Autobuild.CSharp.Tests
|
||||
s = s.Replace($"%{kvp.Key}%", kvp.Value);
|
||||
return s;
|
||||
}
|
||||
|
||||
public void CreateDirectory(string path)
|
||||
{
|
||||
if (!CreateDirectories.Contains(path))
|
||||
throw new ArgumentException($"Missing CreateDirectory, {path}");
|
||||
}
|
||||
|
||||
public void DownloadFile(string address, string fileName)
|
||||
{
|
||||
if (!DownloadFiles.Contains((address, fileName)))
|
||||
throw new ArgumentException($"Missing DownloadFile, {address}, {fileName}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -374,13 +397,13 @@ namespace Semmle.Autobuild.CSharp.Tests
|
||||
public void TestDefaultCSharpAutoBuilder()
|
||||
{
|
||||
Actions.RunProcess["cmd.exe /C dotnet --info"] = 0;
|
||||
Actions.RunProcess["cmd.exe /C dotnet clean test.csproj"] = 0;
|
||||
Actions.RunProcess["cmd.exe /C dotnet restore test.csproj"] = 0;
|
||||
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\odasa index --auto dotnet build --no-incremental test.csproj"] = 0;
|
||||
Actions.RunProcess[@"cmd.exe /C dotnet clean C:\Project\test.csproj"] = 0;
|
||||
Actions.RunProcess[@"cmd.exe /C dotnet restore C:\Project\test.csproj"] = 0;
|
||||
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\odasa index --auto dotnet build --no-incremental C:\Project\test.csproj"] = 0;
|
||||
Actions.RunProcess[@"cmd.exe /C C:\codeql\tools\java\bin\java -jar C:\codeql\csharp\tools\extractor-asp.jar ."] = 0;
|
||||
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\odasa index --xml --extensions config csproj props xml"] = 0;
|
||||
Actions.FileExists["csharp.log"] = true;
|
||||
Actions.FileExists["test.csproj"] = true;
|
||||
Actions.FileExists[@"C:\Project\test.csproj"] = true;
|
||||
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
|
||||
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR"] = "";
|
||||
Actions.EnumerateFiles[@"C:\Project"] = "foo.cs\nbar.cs\ntest.csproj";
|
||||
@@ -393,7 +416,7 @@ namespace Semmle.Autobuild.CSharp.Tests
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>");
|
||||
Actions.LoadXml["test.csproj"] = xml;
|
||||
Actions.LoadXml[@"C:\Project\test.csproj"] = xml;
|
||||
|
||||
var autobuilder = CreateAutoBuilder(true);
|
||||
TestAutobuilderScript(autobuilder, 0, 6);
|
||||
@@ -406,13 +429,13 @@ namespace Semmle.Autobuild.CSharp.Tests
|
||||
Actions.RunProcessOut["dotnet --list-runtimes"] = @"Microsoft.AspNetCore.App 2.2.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
|
||||
Microsoft.NETCore.App 2.2.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]";
|
||||
Actions.RunProcess["dotnet --info"] = 0;
|
||||
Actions.RunProcess["dotnet clean test.csproj"] = 0;
|
||||
Actions.RunProcess["dotnet restore test.csproj"] = 0;
|
||||
Actions.RunProcess[@"C:\odasa/tools/odasa index --auto dotnet build --no-incremental /p:UseSharedCompilation=false test.csproj"] = 0;
|
||||
Actions.RunProcess[@"dotnet clean C:\Project/test.csproj"] = 0;
|
||||
Actions.RunProcess[@"dotnet restore C:\Project/test.csproj"] = 0;
|
||||
Actions.RunProcess[@"C:\odasa/tools/odasa index --auto dotnet build --no-incremental /p:UseSharedCompilation=false C:\Project/test.csproj"] = 0;
|
||||
Actions.RunProcess[@"C:\codeql\tools\java/bin/java -jar C:\codeql\csharp/tools/extractor-asp.jar ."] = 0;
|
||||
Actions.RunProcess[@"C:\odasa/tools/odasa index --xml --extensions config csproj props xml"] = 0;
|
||||
Actions.FileExists["csharp.log"] = true;
|
||||
Actions.FileExists["test.csproj"] = true;
|
||||
Actions.FileExists[@"C:\Project/test.csproj"] = true;
|
||||
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
|
||||
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR"] = "";
|
||||
Actions.EnumerateFiles[@"C:\Project"] = "foo.cs\ntest.cs\ntest.csproj";
|
||||
@@ -425,7 +448,7 @@ Microsoft.NETCore.App 2.2.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.Ap
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>");
|
||||
Actions.LoadXml["test.csproj"] = xml;
|
||||
Actions.LoadXml[@"C:\Project/test.csproj"] = xml;
|
||||
|
||||
var autobuilder = CreateAutoBuilder(false);
|
||||
TestAutobuilderScript(autobuilder, 0, 7);
|
||||
@@ -596,11 +619,11 @@ Microsoft.NETCore.App 2.2.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.Ap
|
||||
Actions.EnumerateDirectories[@"C:\Project"] = "";
|
||||
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
|
||||
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR"] = "";
|
||||
Actions.RunProcess["/bin/chmod u+x build/build.sh"] = 0;
|
||||
Actions.RunProcess[@"/bin/chmod u+x C:\Project/build/build.sh"] = 0;
|
||||
Actions.RunProcess["dotnet --list-runtimes"] = 1;
|
||||
Actions.RunProcessOut["dotnet --list-runtimes"] = "";
|
||||
Actions.RunProcess[@"C:\odasa/tools/odasa index --auto build/build.sh"] = 0;
|
||||
Actions.RunProcessWorkingDirectory[@"C:\odasa/tools/odasa index --auto build/build.sh"] = "build";
|
||||
Actions.RunProcess[@"C:\odasa/tools/odasa index --auto C:\Project/build/build.sh"] = 0;
|
||||
Actions.RunProcessWorkingDirectory[@"C:\odasa/tools/odasa index --auto C:\Project/build/build.sh"] = @"C:\Project/build";
|
||||
Actions.RunProcess[@"C:\codeql\tools\java/bin/java -jar C:\codeql\csharp/tools/extractor-asp.jar ."] = 0;
|
||||
Actions.RunProcess[@"C:\odasa/tools/odasa index --xml --extensions config csproj props xml"] = 0;
|
||||
Actions.FileExists["csharp.log"] = true;
|
||||
@@ -617,11 +640,11 @@ Microsoft.NETCore.App 2.2.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.Ap
|
||||
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
|
||||
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR"] = "";
|
||||
|
||||
Actions.RunProcess["/bin/chmod u+x build.sh"] = 0;
|
||||
Actions.RunProcess[@"/bin/chmod u+x C:\Project/build.sh"] = 0;
|
||||
Actions.RunProcess["dotnet --list-runtimes"] = 1;
|
||||
Actions.RunProcessOut["dotnet --list-runtimes"] = "";
|
||||
Actions.RunProcess[@"C:\odasa/tools/odasa index --auto build.sh"] = 0;
|
||||
Actions.RunProcessWorkingDirectory[@"C:\odasa/tools/odasa index --auto build.sh"] = "";
|
||||
Actions.RunProcess[@"C:\odasa/tools/odasa index --auto C:\Project/build.sh"] = 0;
|
||||
Actions.RunProcessWorkingDirectory[@"C:\odasa/tools/odasa index --auto C:\Project/build.sh"] = @"C:\Project";
|
||||
Actions.FileExists["csharp.log"] = false;
|
||||
|
||||
var autobuilder = CreateAutoBuilder(false);
|
||||
@@ -636,11 +659,11 @@ Microsoft.NETCore.App 2.2.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.Ap
|
||||
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
|
||||
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR"] = "";
|
||||
|
||||
Actions.RunProcess["/bin/chmod u+x build.sh"] = 0;
|
||||
Actions.RunProcess[@"/bin/chmod u+x C:\Project/build.sh"] = 0;
|
||||
Actions.RunProcess["dotnet --list-runtimes"] = 1;
|
||||
Actions.RunProcessOut["dotnet --list-runtimes"] = "";
|
||||
Actions.RunProcess[@"C:\odasa/tools/odasa index --auto build.sh"] = 5;
|
||||
Actions.RunProcessWorkingDirectory[@"C:\odasa/tools/odasa index --auto build.sh"] = "";
|
||||
Actions.RunProcess[@"C:\odasa/tools/odasa index --auto C:\Project/build.sh"] = 5;
|
||||
Actions.RunProcessWorkingDirectory[@"C:\odasa/tools/odasa index --auto C:\Project/build.sh"] = @"C:\Project";
|
||||
Actions.FileExists["csharp.log"] = true;
|
||||
|
||||
var autobuilder = CreateAutoBuilder(false);
|
||||
@@ -654,8 +677,8 @@ Microsoft.NETCore.App 2.2.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.Ap
|
||||
Actions.EnumerateDirectories[@"C:\Project"] = "";
|
||||
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
|
||||
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR"] = "";
|
||||
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\odasa index --auto build.bat"] = 0;
|
||||
Actions.RunProcessWorkingDirectory[@"cmd.exe /C C:\odasa\tools\odasa index --auto build.bat"] = "";
|
||||
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\odasa index --auto C:\Project\build.bat"] = 0;
|
||||
Actions.RunProcessWorkingDirectory[@"cmd.exe /C C:\odasa\tools\odasa index --auto C:\Project\build.bat"] = @"C:\Project";
|
||||
Actions.RunProcess[@"cmd.exe /C C:\codeql\tools\java\bin\java -jar C:\codeql\csharp\tools\extractor-asp.jar ."] = 0;
|
||||
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\odasa index --xml --extensions config csproj props xml"] = 0;
|
||||
Actions.FileExists["csharp.log"] = true;
|
||||
@@ -671,8 +694,8 @@ Microsoft.NETCore.App 2.2.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.Ap
|
||||
Actions.EnumerateDirectories[@"C:\Project"] = "";
|
||||
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
|
||||
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR"] = "";
|
||||
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\odasa index --auto build.bat"] = 1;
|
||||
Actions.RunProcessWorkingDirectory[@"cmd.exe /C C:\odasa\tools\odasa index --auto build.bat"] = "";
|
||||
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\odasa index --auto C:\Project\build.bat"] = 1;
|
||||
Actions.RunProcessWorkingDirectory[@"cmd.exe /C C:\odasa\tools\odasa index --auto C:\Project\build.bat"] = @"C:\Project";
|
||||
Actions.RunProcess[@"cmd.exe /C C:\codeql\tools\java\bin\java -jar C:\codeql\csharp\tools\extractor-asp.jar ."] = 0;
|
||||
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\odasa index --xml --extensions config"] = 0;
|
||||
Actions.FileExists["csharp.log"] = true;
|
||||
@@ -702,9 +725,9 @@ Microsoft.NETCore.App 2.2.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.Ap
|
||||
[Fact]
|
||||
public void TestWindowCSharpMsBuild()
|
||||
{
|
||||
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\csharp\nuget\nuget.exe restore C:\Project\test1.sln"] = 0;
|
||||
Actions.RunProcess[@"cmd.exe /C C:\Project\.nuget\nuget.exe restore C:\Project\test1.sln"] = 0;
|
||||
Actions.RunProcess["cmd.exe /C CALL ^\"C:\\Program Files ^(x86^)\\Microsoft Visual Studio 12.0\\VC\\vcvarsall.bat^\" && set Platform=&& type NUL && C:\\odasa\\tools\\odasa index --auto msbuild C:\\Project\\test1.sln /p:UseSharedCompilation=false /t:Windows /p:Platform=\"x86\" /p:Configuration=\"Debug\" /p:MvcBuildViews=true /P:Fu=Bar"] = 0;
|
||||
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\csharp\nuget\nuget.exe restore C:\Project\test2.sln"] = 0;
|
||||
Actions.RunProcess[@"cmd.exe /C C:\Project\.nuget\nuget.exe restore C:\Project\test2.sln"] = 0;
|
||||
Actions.RunProcess["cmd.exe /C CALL ^\"C:\\Program Files ^(x86^)\\Microsoft Visual Studio 12.0\\VC\\vcvarsall.bat^\" && set Platform=&& type NUL && C:\\odasa\\tools\\odasa index --auto msbuild C:\\Project\\test2.sln /p:UseSharedCompilation=false /t:Windows /p:Platform=\"x86\" /p:Configuration=\"Debug\" /p:MvcBuildViews=true /P:Fu=Bar"] = 0;
|
||||
Actions.RunProcess[@"cmd.exe /C C:\codeql\tools\java\bin\java -jar C:\codeql\csharp\tools\extractor-asp.jar ."] = 0;
|
||||
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\odasa index --xml --extensions config csproj props xml"] = 0;
|
||||
@@ -718,7 +741,9 @@ Microsoft.NETCore.App 2.2.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.Ap
|
||||
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
|
||||
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR"] = "";
|
||||
Actions.EnumerateFiles[@"C:\Project"] = "foo.cs\ntest1.cs\ntest2.cs";
|
||||
Actions.EnumerateDirectories[@"C:\Project"] = "";
|
||||
Actions.EnumerateFiles[@"C:\Project\.nuget"] = "nuget.exe";
|
||||
Actions.EnumerateDirectories[@"C:\Project"] = @".nuget";
|
||||
Actions.EnumerateDirectories[@"C:\Project\.nuget"] = "";
|
||||
|
||||
var autobuilder = CreateAutoBuilder(true, msBuildArguments: "/P:Fu=Bar", msBuildTarget: "Windows", msBuildPlatform: "x86", msBuildConfiguration: "Debug",
|
||||
vsToolsVersion: "12", allSolutions: "true");
|
||||
@@ -733,15 +758,15 @@ Microsoft.NETCore.App 2.2.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.Ap
|
||||
[Fact]
|
||||
public void TestWindowCSharpMsBuildMultipleSolutions()
|
||||
{
|
||||
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\csharp\nuget\nuget.exe restore test1.csproj"] = 0;
|
||||
Actions.RunProcess["cmd.exe /C CALL ^\"C:\\Program Files ^(x86^)\\Microsoft Visual Studio 12.0\\VC\\vcvarsall.bat^\" && set Platform=&& type NUL && C:\\odasa\\tools\\odasa index --auto msbuild test1.csproj /p:UseSharedCompilation=false /t:Windows /p:Platform=\"x86\" /p:Configuration=\"Debug\" /p:MvcBuildViews=true /P:Fu=Bar"] = 0;
|
||||
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\csharp\nuget\nuget.exe restore test2.csproj"] = 0;
|
||||
Actions.RunProcess["cmd.exe /C CALL ^\"C:\\Program Files ^(x86^)\\Microsoft Visual Studio 12.0\\VC\\vcvarsall.bat^\" && set Platform=&& type NUL && C:\\odasa\\tools\\odasa index --auto msbuild test2.csproj /p:UseSharedCompilation=false /t:Windows /p:Platform=\"x86\" /p:Configuration=\"Debug\" /p:MvcBuildViews=true /P:Fu=Bar"] = 0;
|
||||
Actions.RunProcess[@"cmd.exe /C nuget restore C:\Project\test1.csproj"] = 0;
|
||||
Actions.RunProcess["cmd.exe /C CALL ^\"C:\\Program Files ^(x86^)\\Microsoft Visual Studio 12.0\\VC\\vcvarsall.bat^\" && set Platform=&& type NUL && C:\\odasa\\tools\\odasa index --auto msbuild C:\\Project\\test1.csproj /p:UseSharedCompilation=false /t:Windows /p:Platform=\"x86\" /p:Configuration=\"Debug\" /p:MvcBuildViews=true /P:Fu=Bar"] = 0;
|
||||
Actions.RunProcess[@"cmd.exe /C nuget restore C:\Project\test2.csproj"] = 0;
|
||||
Actions.RunProcess["cmd.exe /C CALL ^\"C:\\Program Files ^(x86^)\\Microsoft Visual Studio 12.0\\VC\\vcvarsall.bat^\" && set Platform=&& type NUL && C:\\odasa\\tools\\odasa index --auto msbuild C:\\Project\\test2.csproj /p:UseSharedCompilation=false /t:Windows /p:Platform=\"x86\" /p:Configuration=\"Debug\" /p:MvcBuildViews=true /P:Fu=Bar"] = 0;
|
||||
Actions.RunProcess[@"cmd.exe /C C:\codeql\tools\java\bin\java -jar C:\codeql\csharp\tools\extractor-asp.jar ."] = 0;
|
||||
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\odasa index --xml --extensions config csproj props xml"] = 0;
|
||||
Actions.FileExists["csharp.log"] = true;
|
||||
Actions.FileExists[@"test1.csproj"] = true;
|
||||
Actions.FileExists[@"test2.csproj"] = true;
|
||||
Actions.FileExists[@"C:\Project\test1.csproj"] = true;
|
||||
Actions.FileExists[@"C:\Project\test2.csproj"] = true;
|
||||
Actions.FileExists[@"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe"] = false;
|
||||
Actions.FileExists[@"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"] = false;
|
||||
Actions.FileExists[@"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"] = true;
|
||||
@@ -760,7 +785,7 @@ Microsoft.NETCore.App 2.2.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.Ap
|
||||
<Compile Include=""test1.cs"" />
|
||||
</ItemGroup>
|
||||
</Project>");
|
||||
Actions.LoadXml["test1.csproj"] = csproj1;
|
||||
Actions.LoadXml[@"C:\Project\test1.csproj"] = csproj1;
|
||||
|
||||
var csproj2 = new XmlDocument();
|
||||
csproj2.LoadXml(@"<?xml version=""1.0"" encoding=""utf - 8""?>
|
||||
@@ -769,7 +794,7 @@ Microsoft.NETCore.App 2.2.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.Ap
|
||||
<Compile Include=""test1.cs"" />
|
||||
</ItemGroup>
|
||||
</Project>");
|
||||
Actions.LoadXml["test2.csproj"] = csproj2;
|
||||
Actions.LoadXml[@"C:\Project\test2.csproj"] = csproj2;
|
||||
|
||||
var autobuilder = CreateAutoBuilder(true, msBuildArguments: "/P:Fu=Bar", msBuildTarget: "Windows", msBuildPlatform: "x86", msBuildConfiguration: "Debug",
|
||||
vsToolsVersion: "12");
|
||||
@@ -780,7 +805,7 @@ Microsoft.NETCore.App 2.2.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.Ap
|
||||
[Fact]
|
||||
public void TestWindowCSharpMsBuildFailed()
|
||||
{
|
||||
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\csharp\nuget\nuget.exe restore C:\Project\test1.sln"] = 0;
|
||||
Actions.RunProcess[@"cmd.exe /C nuget restore C:\Project\test1.sln"] = 0;
|
||||
Actions.RunProcess["cmd.exe /C CALL ^\"C:\\Program Files ^(x86^)\\Microsoft Visual Studio 12.0\\VC\\vcvarsall.bat^\" && set Platform=&& type NUL && C:\\odasa\\tools\\odasa index --auto msbuild C:\\Project\\test1.sln /p:UseSharedCompilation=false /t:Windows /p:Platform=\"x86\" /p:Configuration=\"Debug\" /p:MvcBuildViews=true /P:Fu=Bar"] = 1;
|
||||
Actions.FileExists["csharp.log"] = true;
|
||||
Actions.FileExists[@"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe"] = false;
|
||||
@@ -857,13 +882,13 @@ Microsoft.NETCore.App 2.2.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.Ap
|
||||
Actions.RunProcessOut["dotnet --list-runtimes"] = @"Microsoft.AspNetCore.App 2.1.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
|
||||
Microsoft.NETCore.App 2.1.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]";
|
||||
Actions.RunProcess["dotnet --info"] = 0;
|
||||
Actions.RunProcess["dotnet clean test.csproj"] = 0;
|
||||
Actions.RunProcess["dotnet restore test.csproj"] = 0;
|
||||
Actions.RunProcess[@"C:\odasa/tools/odasa index --auto dotnet build --no-incremental /p:UseSharedCompilation=false --no-restore test.csproj"] = 0;
|
||||
Actions.RunProcess[@"dotnet clean C:\Project/test.csproj"] = 0;
|
||||
Actions.RunProcess[@"dotnet restore C:\Project/test.csproj"] = 0;
|
||||
Actions.RunProcess[@"C:\odasa/tools/odasa index --auto dotnet build --no-incremental /p:UseSharedCompilation=false --no-restore C:\Project/test.csproj"] = 0;
|
||||
Actions.RunProcess[@"C:\codeql\tools\java/bin/java -jar C:\codeql\csharp/tools/extractor-asp.jar ."] = 0;
|
||||
Actions.RunProcess[@"C:\odasa/tools/odasa index --xml --extensions config csproj props xml"] = 0;
|
||||
Actions.FileExists["csharp.log"] = true;
|
||||
Actions.FileExists["test.csproj"] = true;
|
||||
Actions.FileExists[@"C:\Project/test.csproj"] = true;
|
||||
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
|
||||
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR"] = "";
|
||||
Actions.EnumerateFiles[@"C:\Project"] = "foo.cs\ntest.cs\ntest.csproj";
|
||||
@@ -876,7 +901,7 @@ Microsoft.NETCore.App 2.1.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.Ap
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>");
|
||||
Actions.LoadXml["test.csproj"] = xml;
|
||||
Actions.LoadXml[@"C:\Project/test.csproj"] = xml;
|
||||
|
||||
var autobuilder = CreateAutoBuilder(false, dotnetArguments: "--no-restore"); // nugetRestore=false does not work for now.
|
||||
TestAutobuilderScript(autobuilder, 0, 7);
|
||||
@@ -887,7 +912,6 @@ Microsoft.NETCore.App 2.1.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.Ap
|
||||
{
|
||||
Actions.RunProcess["dotnet --list-sdks"] = 0;
|
||||
Actions.RunProcessOut["dotnet --list-sdks"] = "2.1.2 [C:\\Program Files\\dotnet\\sdks]\n2.1.4 [C:\\Program Files\\dotnet\\sdks]";
|
||||
Actions.RunProcess[@"curl -L -sO https://dot.net/v1/dotnet-install.sh"] = 0;
|
||||
Actions.RunProcess[@"chmod u+x dotnet-install.sh"] = 0;
|
||||
Actions.RunProcess[@"./dotnet-install.sh --channel release --version 2.1.3 --install-dir C:\Project/.dotnet"] = 0;
|
||||
Actions.RunProcess[@"rm dotnet-install.sh"] = 0;
|
||||
@@ -895,9 +919,9 @@ Microsoft.NETCore.App 2.1.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.Ap
|
||||
Actions.RunProcessOut[@"C:\Project/.dotnet/dotnet --list-runtimes"] = @"Microsoft.AspNetCore.App 3.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
|
||||
Microsoft.NETCore.App 3.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]";
|
||||
Actions.RunProcess[@"C:\Project/.dotnet/dotnet --info"] = 0;
|
||||
Actions.RunProcess[@"C:\Project/.dotnet/dotnet clean test.csproj"] = 0;
|
||||
Actions.RunProcess[@"C:\Project/.dotnet/dotnet restore test.csproj"] = 0;
|
||||
Actions.RunProcess[@"C:\odasa/tools/odasa index --auto C:\Project/.dotnet/dotnet build --no-incremental test.csproj"] = 0;
|
||||
Actions.RunProcess[@"C:\Project/.dotnet/dotnet clean C:\Project/test.csproj"] = 0;
|
||||
Actions.RunProcess[@"C:\Project/.dotnet/dotnet restore C:\Project/test.csproj"] = 0;
|
||||
Actions.RunProcess[@"C:\odasa/tools/odasa index --auto C:\Project/.dotnet/dotnet build --no-incremental C:\Project/test.csproj"] = 0;
|
||||
Actions.RunProcess[@"C:\codeql\tools\java/bin/java -jar C:\codeql\csharp/tools/extractor-asp.jar ."] = 0;
|
||||
Actions.RunProcess[@"C:\odasa/tools/odasa index --xml --extensions config csproj props xml"] = 0;
|
||||
Actions.FileExists["csharp.log"] = true;
|
||||
@@ -915,10 +939,11 @@ Microsoft.NETCore.App 3.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.Ap
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>");
|
||||
Actions.LoadXml["test.csproj"] = xml;
|
||||
Actions.LoadXml[@"C:\Project/test.csproj"] = xml;
|
||||
Actions.DownloadFiles.Add(("https://dot.net/v1/dotnet-install.sh", "dotnet-install.sh"));
|
||||
|
||||
var autobuilder = CreateAutoBuilder(false, dotnetVersion: "2.1.3");
|
||||
TestAutobuilderScript(autobuilder, 0, 12);
|
||||
TestAutobuilderScript(autobuilder, 0, 11);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -927,7 +952,6 @@ Microsoft.NETCore.App 3.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.Ap
|
||||
Actions.RunProcess["dotnet --list-sdks"] = 0;
|
||||
Actions.RunProcessOut["dotnet --list-sdks"] = @"2.1.3 [C:\Program Files\dotnet\sdks]
|
||||
2.1.4 [C:\Program Files\dotnet\sdks]";
|
||||
Actions.RunProcess[@"curl -L -sO https://dot.net/v1/dotnet-install.sh"] = 0;
|
||||
Actions.RunProcess[@"chmod u+x dotnet-install.sh"] = 0;
|
||||
Actions.RunProcess[@"./dotnet-install.sh --channel release --version 2.1.3 --install-dir C:\Project/.dotnet"] = 0;
|
||||
Actions.RunProcess[@"rm dotnet-install.sh"] = 0;
|
||||
@@ -937,9 +961,9 @@ Microsoft.AspNetCore.App 2.1.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetC
|
||||
Microsoft.NETCore.App 2.1.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
|
||||
Microsoft.NETCore.App 2.1.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]";
|
||||
Actions.RunProcess[@"C:\Project/.dotnet/dotnet --info"] = 0;
|
||||
Actions.RunProcess[@"C:\Project/.dotnet/dotnet clean test.csproj"] = 0;
|
||||
Actions.RunProcess[@"C:\Project/.dotnet/dotnet restore test.csproj"] = 0;
|
||||
Actions.RunProcess[@"C:\odasa/tools/odasa index --auto C:\Project/.dotnet/dotnet build --no-incremental /p:UseSharedCompilation=false test.csproj"] = 0;
|
||||
Actions.RunProcess[@"C:\Project/.dotnet/dotnet clean C:\Project/test.csproj"] = 0;
|
||||
Actions.RunProcess[@"C:\Project/.dotnet/dotnet restore C:\Project/test.csproj"] = 0;
|
||||
Actions.RunProcess[@"C:\odasa/tools/odasa index --auto C:\Project/.dotnet/dotnet build --no-incremental /p:UseSharedCompilation=false C:\Project/test.csproj"] = 0;
|
||||
Actions.RunProcess[@"C:\codeql\tools\java/bin/java -jar C:\codeql\csharp/tools/extractor-asp.jar ."] = 0;
|
||||
Actions.RunProcess[@"C:\odasa/tools/odasa index --xml --extensions config csproj props xml"] = 0;
|
||||
Actions.FileExists["csharp.log"] = true;
|
||||
@@ -957,10 +981,11 @@ Microsoft.NETCore.App 2.1.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.Ap
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>");
|
||||
Actions.LoadXml["test.csproj"] = xml;
|
||||
Actions.LoadXml[@"C:\Project/test.csproj"] = xml;
|
||||
Actions.DownloadFiles.Add(("https://dot.net/v1/dotnet-install.sh", "dotnet-install.sh"));
|
||||
|
||||
var autobuilder = CreateAutoBuilder(false, dotnetVersion: "2.1.3");
|
||||
TestAutobuilderScript(autobuilder, 0, 12);
|
||||
TestAutobuilderScript(autobuilder, 0, 11);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -971,13 +996,13 @@ Microsoft.NETCore.App 2.1.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.Ap
|
||||
Actions.RunProcess[@"cmd.exe /C powershell -NoProfile -ExecutionPolicy unrestricted -file C:\Project\install-dotnet.ps1 -Version 2.1.3 -InstallDir C:\Project\.dotnet"] = 0;
|
||||
Actions.RunProcess[@"cmd.exe /C del C:\Project\install-dotnet.ps1"] = 0;
|
||||
Actions.RunProcess[@"cmd.exe /C C:\Project\.dotnet\dotnet --info"] = 0;
|
||||
Actions.RunProcess[@"cmd.exe /C C:\Project\.dotnet\dotnet clean test.csproj"] = 0;
|
||||
Actions.RunProcess[@"cmd.exe /C C:\Project\.dotnet\dotnet restore test.csproj"] = 0;
|
||||
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\odasa index --auto C:\Project\.dotnet\dotnet build --no-incremental test.csproj"] = 0;
|
||||
Actions.RunProcess[@"cmd.exe /C C:\Project\.dotnet\dotnet clean C:\Project\test.csproj"] = 0;
|
||||
Actions.RunProcess[@"cmd.exe /C C:\Project\.dotnet\dotnet restore C:\Project\test.csproj"] = 0;
|
||||
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\odasa index --auto C:\Project\.dotnet\dotnet build --no-incremental C:\Project\test.csproj"] = 0;
|
||||
Actions.RunProcess[@"cmd.exe /C C:\codeql\tools\java\bin\java -jar C:\codeql\csharp\tools\extractor-asp.jar ."] = 0;
|
||||
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\odasa index --xml --extensions config csproj props xml"] = 0;
|
||||
Actions.FileExists["csharp.log"] = true;
|
||||
Actions.FileExists["test.csproj"] = true;
|
||||
Actions.FileExists[@"C:\Project\test.csproj"] = true;
|
||||
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
|
||||
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR"] = "";
|
||||
Actions.GetEnvironmentVariable["PATH"] = "/bin:/usr/bin";
|
||||
@@ -991,7 +1016,7 @@ Microsoft.NETCore.App 2.1.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.Ap
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>");
|
||||
Actions.LoadXml["test.csproj"] = xml;
|
||||
Actions.LoadXml[@"C:\Project\test.csproj"] = xml;
|
||||
|
||||
var autobuilder = CreateAutoBuilder(true, dotnetVersion: "2.1.3");
|
||||
TestAutobuilderScript(autobuilder, 0, 9);
|
||||
@@ -1000,13 +1025,14 @@ Microsoft.NETCore.App 2.1.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.Ap
|
||||
[Fact]
|
||||
public void TestDirsProjWindows()
|
||||
{
|
||||
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\csharp\nuget\nuget.exe restore dirs.proj"] = 1;
|
||||
Actions.RunProcess["cmd.exe /C CALL ^\"C:\\Program Files ^(x86^)\\Microsoft Visual Studio 12.0\\VC\\vcvarsall.bat^\" && set Platform=&& type NUL && C:\\odasa\\tools\\odasa index --auto msbuild dirs.proj /p:UseSharedCompilation=false /t:Windows /p:Platform=\"x86\" /p:Configuration=\"Debug\" /p:MvcBuildViews=true /P:Fu=Bar"] = 0;
|
||||
Actions.RunProcess[@"cmd.exe /C nuget restore C:\Project\dirs.proj"] = 1;
|
||||
Actions.RunProcess[@"cmd.exe /C C:\Project\.nuget\nuget.exe restore C:\Project\dirs.proj"] = 0;
|
||||
Actions.RunProcess["cmd.exe /C CALL ^\"C:\\Program Files ^(x86^)\\Microsoft Visual Studio 12.0\\VC\\vcvarsall.bat^\" && set Platform=&& type NUL && C:\\odasa\\tools\\odasa index --auto msbuild C:\\Project\\dirs.proj /p:UseSharedCompilation=false /t:Windows /p:Platform=\"x86\" /p:Configuration=\"Debug\" /p:MvcBuildViews=true /P:Fu=Bar"] = 0;
|
||||
Actions.RunProcess[@"cmd.exe /C C:\codeql\tools\java\bin\java -jar C:\codeql\csharp\tools\extractor-asp.jar ."] = 0;
|
||||
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\odasa index --xml --extensions config csproj props xml"] = 0;
|
||||
Actions.FileExists["csharp.log"] = true;
|
||||
Actions.FileExists[@"a\test.csproj"] = true;
|
||||
Actions.FileExists["dirs.proj"] = true;
|
||||
Actions.FileExists[@"C:\Project\a\test.csproj"] = true;
|
||||
Actions.FileExists[@"C:\Project\dirs.proj"] = true;
|
||||
Actions.FileExists[@"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe"] = false;
|
||||
Actions.FileExists[@"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"] = false;
|
||||
Actions.FileExists[@"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"] = true;
|
||||
@@ -1017,6 +1043,8 @@ Microsoft.NETCore.App 2.1.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.Ap
|
||||
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR"] = "";
|
||||
Actions.EnumerateFiles[@"C:\Project"] = "a\\test.cs\na\\test.csproj\ndirs.proj";
|
||||
Actions.EnumerateDirectories[@"C:\Project"] = "";
|
||||
Actions.CreateDirectories.Add(@"C:\Project\.nuget");
|
||||
Actions.DownloadFiles.Add(("https://dist.nuget.org/win-x86-commandline/latest/nuget.exe", @"C:\Project\.nuget\nuget.exe"));
|
||||
|
||||
var csproj = new XmlDocument();
|
||||
csproj.LoadXml(@"<?xml version=""1.0"" encoding=""utf - 8""?>
|
||||
@@ -1025,7 +1053,7 @@ Microsoft.NETCore.App 2.1.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.Ap
|
||||
<Compile Include=""test.cs"" />
|
||||
</ItemGroup>
|
||||
</Project>");
|
||||
Actions.LoadXml["a\\test.csproj"] = csproj;
|
||||
Actions.LoadXml[@"C:\Project\a\test.csproj"] = csproj;
|
||||
|
||||
var dirsproj = new XmlDocument();
|
||||
dirsproj.LoadXml(@"<Project DefaultTargets=""Build"" xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""3.5"">
|
||||
@@ -1033,27 +1061,30 @@ Microsoft.NETCore.App 2.1.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.Ap
|
||||
<ProjectFiles Include=""a\test.csproj"" />
|
||||
</ItemGroup>
|
||||
</Project>");
|
||||
Actions.LoadXml["dirs.proj"] = dirsproj;
|
||||
Actions.LoadXml[@"C:\Project\dirs.proj"] = dirsproj;
|
||||
|
||||
var autobuilder = CreateAutoBuilder(true, msBuildArguments: "/P:Fu=Bar", msBuildTarget: "Windows", msBuildPlatform: "x86", msBuildConfiguration: "Debug",
|
||||
vsToolsVersion: "12", allSolutions: "true");
|
||||
TestAutobuilderScript(autobuilder, 0, 4);
|
||||
TestAutobuilderScript(autobuilder, 0, 5);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestDirsProjLinux()
|
||||
{
|
||||
Actions.RunProcess[@"mono C:\odasa\tools/csharp/nuget/nuget.exe restore dirs.proj"] = 1;
|
||||
Actions.RunProcess[@"C:\odasa/tools/odasa index --auto msbuild dirs.proj /p:UseSharedCompilation=false /t:rebuild /p:MvcBuildViews=true"] = 0;
|
||||
Actions.RunProcess[@"nuget restore C:\Project/dirs.proj"] = 1;
|
||||
Actions.RunProcess[@"mono C:\Project/.nuget/nuget.exe restore C:\Project/dirs.proj"] = 0;
|
||||
Actions.RunProcess[@"C:\odasa/tools/odasa index --auto msbuild C:\Project/dirs.proj /p:UseSharedCompilation=false /t:rebuild /p:MvcBuildViews=true"] = 0;
|
||||
Actions.RunProcess[@"C:\codeql\tools\java/bin/java -jar C:\codeql\csharp/tools/extractor-asp.jar ."] = 0;
|
||||
Actions.RunProcess[@"C:\odasa/tools/odasa index --xml --extensions config csproj props xml"] = 0;
|
||||
Actions.FileExists["csharp.log"] = true;
|
||||
Actions.FileExists["a/test.csproj"] = true;
|
||||
Actions.FileExists["dirs.proj"] = true;
|
||||
Actions.FileExists[@"C:\Project/a/test.csproj"] = true;
|
||||
Actions.FileExists[@"C:\Project/dirs.proj"] = true;
|
||||
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
|
||||
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR"] = "";
|
||||
Actions.EnumerateFiles[@"C:\Project"] = "a/test.cs\na/test.csproj\ndirs.proj";
|
||||
Actions.EnumerateDirectories[@"C:\Project"] = "";
|
||||
Actions.CreateDirectories.Add(@"C:\Project/.nuget");
|
||||
Actions.DownloadFiles.Add(("https://dist.nuget.org/win-x86-commandline/latest/nuget.exe", @"C:\Project/.nuget/nuget.exe"));
|
||||
|
||||
var csproj = new XmlDocument();
|
||||
csproj.LoadXml(@"<?xml version=""1.0"" encoding=""utf - 8""?>
|
||||
@@ -1062,7 +1093,7 @@ Microsoft.NETCore.App 2.1.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.Ap
|
||||
<Compile Include=""test.cs"" />
|
||||
</ItemGroup>
|
||||
</Project>");
|
||||
Actions.LoadXml["a/test.csproj"] = csproj;
|
||||
Actions.LoadXml[@"C:\Project/a/test.csproj"] = csproj;
|
||||
|
||||
var dirsproj = new XmlDocument();
|
||||
dirsproj.LoadXml(@"<Project DefaultTargets=""Build"" xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""3.5"">
|
||||
@@ -1070,10 +1101,10 @@ Microsoft.NETCore.App 2.1.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.Ap
|
||||
<ProjectFiles Include=""a\test.csproj"" />
|
||||
</ItemGroup>
|
||||
</Project>");
|
||||
Actions.LoadXml["dirs.proj"] = dirsproj;
|
||||
Actions.LoadXml[@"C:\Project/dirs.proj"] = dirsproj;
|
||||
|
||||
var autobuilder = CreateAutoBuilder(false);
|
||||
TestAutobuilderScript(autobuilder, 0, 4);
|
||||
TestAutobuilderScript(autobuilder, 0, 5);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -1092,7 +1123,7 @@ Microsoft.NETCore.App 2.1.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.Ap
|
||||
<ProjectFiles Include=""dirs.proj"" />
|
||||
</ItemGroup>
|
||||
</Project>");
|
||||
Actions.LoadXml["dirs.proj"] = dirsproj1;
|
||||
Actions.LoadXml[@"C:\Project/dirs.proj"] = dirsproj1;
|
||||
|
||||
var autobuilder = CreateAutoBuilder(false);
|
||||
TestAutobuilderScript(autobuilder, 1, 0);
|
||||
|
||||
@@ -229,11 +229,10 @@ Invoke-Command -ScriptBlock $ScriptBlock";
|
||||
}
|
||||
else
|
||||
{
|
||||
var curl = new CommandBuilder(builder.Actions).
|
||||
RunCommand("curl").
|
||||
Argument("-L").
|
||||
Argument("-sO").
|
||||
Argument("https://dot.net/v1/dotnet-install.sh");
|
||||
var downloadDotNetInstallSh = BuildScript.DownloadFile(
|
||||
"https://dot.net/v1/dotnet-install.sh",
|
||||
"dotnet-install.sh",
|
||||
e => builder.Log(Severity.Warning, $"Failed to download 'dotnet-install.sh': {e.Message}"));
|
||||
|
||||
var chmod = new CommandBuilder(builder.Actions).
|
||||
RunCommand("chmod").
|
||||
@@ -253,7 +252,7 @@ Invoke-Command -ScriptBlock $ScriptBlock";
|
||||
RunCommand("rm").
|
||||
Argument("dotnet-install.sh");
|
||||
|
||||
return curl.Script & chmod.Script & install.Script & BuildScript.Try(removeScript.Script);
|
||||
return downloadDotNetInstallSh & chmod.Script & install.Script & BuildScript.Try(removeScript.Script);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace Semmle.Autobuild.Shared
|
||||
/// <param name="name">The filename to find.</param>
|
||||
/// <returns>Possibly empty sequence of paths with the given filename.</returns>
|
||||
public IEnumerable<(string, int)> GetFilename(string name) =>
|
||||
Paths.Where(p => Path.GetFileName(p.Item1) == name);
|
||||
Paths.Where(p => Actions.GetFileName(p.Item1) == name);
|
||||
|
||||
/// <summary>
|
||||
/// Holds if a given path, relative to the root of the source directory
|
||||
|
||||
@@ -4,6 +4,9 @@ using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Xml;
|
||||
using System.Net.Http;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Semmle.Autobuild.Shared
|
||||
{
|
||||
@@ -58,6 +61,11 @@ namespace Semmle.Autobuild.Shared
|
||||
/// </summary>
|
||||
void DirectoryDelete(string dir, bool recursive);
|
||||
|
||||
/// <summary>
|
||||
/// Creates all directories and subdirectories in the specified path unless they already exist.
|
||||
/// </summary>
|
||||
void CreateDirectory(string path);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an environment variable, Environment.GetEnvironmentVariable().
|
||||
/// </summary>
|
||||
@@ -102,6 +110,17 @@ namespace Semmle.Autobuild.Shared
|
||||
/// </summary>
|
||||
string GetFullPath(string path);
|
||||
|
||||
/// <summary>
|
||||
/// Returns the file name and extension of the specified path string.
|
||||
/// </summary>
|
||||
[return: NotNullIfNotNull("path")]
|
||||
string? GetFileName(string? path);
|
||||
|
||||
/// <summary>
|
||||
/// Returns the directory information for the specified path string.
|
||||
/// </summary>
|
||||
string? GetDirectoryName(string? path);
|
||||
|
||||
/// <summary>
|
||||
/// Writes contents to file, File.WriteAllText().
|
||||
/// </summary>
|
||||
@@ -114,11 +133,12 @@ namespace Semmle.Autobuild.Shared
|
||||
/// </summary>
|
||||
XmlDocument LoadXml(string filename);
|
||||
|
||||
/// <summary>
|
||||
/// Expand all Windows-style environment variables in <paramref name="s"/>,
|
||||
/// Environment.ExpandEnvironmentVariables()
|
||||
/// </summary>
|
||||
string EnvironmentExpandEnvironmentVariables(string s);
|
||||
|
||||
/// <summary>
|
||||
/// Downloads the resource with the specified URI to a local file.
|
||||
/// </summary>
|
||||
void DownloadFile(string address, string fileName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -166,6 +186,8 @@ namespace Semmle.Autobuild.Shared
|
||||
|
||||
bool IBuildActions.DirectoryExists(string dir) => Directory.Exists(dir);
|
||||
|
||||
void IBuildActions.CreateDirectory(string path) => Directory.CreateDirectory(path);
|
||||
|
||||
string? IBuildActions.GetEnvironmentVariable(string name) => Environment.GetEnvironmentVariable(name);
|
||||
|
||||
string IBuildActions.GetCurrentDirectory() => Directory.GetCurrentDirectory();
|
||||
@@ -189,8 +211,24 @@ namespace Semmle.Autobuild.Shared
|
||||
|
||||
string IBuildActions.GetFullPath(string path) => Path.GetFullPath(path);
|
||||
|
||||
string? IBuildActions.GetFileName(string? path) => Path.GetFileName(path);
|
||||
|
||||
string? IBuildActions.GetDirectoryName(string? path) => Path.GetDirectoryName(path);
|
||||
|
||||
public string EnvironmentExpandEnvironmentVariables(string s) => Environment.ExpandEnvironmentVariables(s);
|
||||
|
||||
static async Task DownloadFileAsync(string address, string filename)
|
||||
{
|
||||
using var httpClient = new HttpClient();
|
||||
using var request = new HttpRequestMessage(HttpMethod.Get, address);
|
||||
using var contentStream = await (await httpClient.SendAsync(request)).Content.ReadAsStreamAsync();
|
||||
using var stream = new FileStream(filename, FileMode.Create, FileAccess.Write, FileShare.None, 4096, true);
|
||||
await contentStream.CopyToAsync(stream);
|
||||
}
|
||||
|
||||
public void DownloadFile(string address, string fileName) =>
|
||||
DownloadFileAsync(address, fileName).Wait();
|
||||
|
||||
public static readonly IBuildActions Instance = new SystemBuildActions();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace Semmle.Autobuild.Shared
|
||||
chmod.RunCommand("/bin/chmod", $"u+x {scriptPath}");
|
||||
var chmodScript = builder.Actions.IsWindows() ? BuildScript.Success : BuildScript.Try(chmod.Script);
|
||||
|
||||
string? dir = Path.GetDirectoryName(scriptPath);
|
||||
string? dir = builder.Actions.GetDirectoryName(scriptPath);
|
||||
|
||||
// A specific .NET Core version may be required
|
||||
return chmodScript & withDotNet(builder, environment =>
|
||||
|
||||
@@ -192,6 +192,26 @@ namespace Semmle.Autobuild.Shared
|
||||
public static BuildScript Create(Func<IBuildActions, int> func) =>
|
||||
new ReturnBuildCommand(func);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a build script that downloads the specified file.
|
||||
/// </summary>
|
||||
public static BuildScript DownloadFile(string address, string fileName, Action<Exception> exceptionCallback) =>
|
||||
Create(actions =>
|
||||
{
|
||||
if (actions.GetDirectoryName(fileName) is string dir && !string.IsNullOrWhiteSpace(dir))
|
||||
actions.CreateDirectory(dir);
|
||||
try
|
||||
{
|
||||
actions.DownloadFile(address, fileName);
|
||||
return 0;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
exceptionCallback(e);
|
||||
return 1;
|
||||
}
|
||||
});
|
||||
|
||||
/// <summary>
|
||||
/// Creates a build script that runs <paramref name="s1"/>, followed by running the script
|
||||
/// produced by <paramref name="s2"/> on the exit code from <paramref name="s1"/>.
|
||||
|
||||
@@ -36,10 +36,11 @@ namespace Semmle.Autobuild.Shared
|
||||
builder.Log(Severity.Warning, "Could not find a suitable version of VsDevCmd.bat/vcvarsall.bat");
|
||||
}
|
||||
|
||||
var nuget =
|
||||
builder.SemmlePlatformTools != null ?
|
||||
builder.Actions.PathCombine(builder.SemmlePlatformTools, "csharp", "nuget", "nuget.exe") :
|
||||
"nuget";
|
||||
// Use `nuget.exe` from source code repo, if present, otherwise first attempt with global
|
||||
// `nuget` command, and if that fails, attempt to download `nuget.exe` from nuget.org
|
||||
var nuget = builder.GetFilename("nuget.exe").Select(t => t.Item1).FirstOrDefault() ?? "nuget";
|
||||
var nugetDownload = builder.Actions.PathCombine(builder.Options.RootDirectory, ".nuget", "nuget.exe");
|
||||
var nugetDownloaded = false;
|
||||
|
||||
var ret = BuildScript.Success;
|
||||
|
||||
@@ -47,11 +48,36 @@ namespace Semmle.Autobuild.Shared
|
||||
{
|
||||
if (builder.Options.NugetRestore)
|
||||
{
|
||||
var nugetCommand = new CommandBuilder(builder.Actions).
|
||||
RunCommand(nuget).
|
||||
Argument("restore").
|
||||
BuildScript GetNugetRestoreScript() =>
|
||||
new CommandBuilder(builder.Actions).
|
||||
RunCommand(nuget).
|
||||
Argument("restore").
|
||||
QuoteArgument(projectOrSolution.FullPath).
|
||||
Script;
|
||||
var nugetRestore = GetNugetRestoreScript();
|
||||
var msbuildRestoreCommand = new CommandBuilder(builder.Actions).
|
||||
RunCommand(MsBuild).
|
||||
Argument("/t:restore").
|
||||
QuoteArgument(projectOrSolution.FullPath);
|
||||
ret &= BuildScript.Try(nugetCommand.Script);
|
||||
|
||||
if (nugetDownloaded)
|
||||
ret &= BuildScript.Try(nugetRestore | msbuildRestoreCommand.Script);
|
||||
else
|
||||
{
|
||||
// If `nuget restore` fails, and we have not already attempted to download `nuget.exe`,
|
||||
// download it and reattempt `nuget restore`.
|
||||
var nugetDownloadAndRestore =
|
||||
BuildScript.Bind(DownloadNugetExe(builder, nugetDownload), exitCode =>
|
||||
{
|
||||
nugetDownloaded = true;
|
||||
if (exitCode != 0)
|
||||
return BuildScript.Failure;
|
||||
|
||||
nuget = nugetDownload;
|
||||
return GetNugetRestoreScript();
|
||||
});
|
||||
ret &= BuildScript.Try(nugetRestore | nugetDownloadAndRestore | msbuildRestoreCommand.Script);
|
||||
}
|
||||
}
|
||||
|
||||
var command = new CommandBuilder(builder.Actions);
|
||||
@@ -130,5 +156,26 @@ namespace Semmle.Autobuild.Shared
|
||||
|
||||
return vsTools;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a script for downloading `nuget.exe` from nuget.org.
|
||||
/// </summary>
|
||||
static BuildScript DownloadNugetExe(Autobuilder builder, string path) =>
|
||||
BuildScript.Create(_ =>
|
||||
{
|
||||
builder.Log(Severity.Info, "Attempting to download nuget.exe");
|
||||
return 0;
|
||||
})
|
||||
&
|
||||
BuildScript.DownloadFile(
|
||||
"https://dist.nuget.org/win-x86-commandline/latest/nuget.exe",
|
||||
path,
|
||||
e => builder.Log(Severity.Warning, $"Failed to download 'nuget.exe': {e.Message}"))
|
||||
&
|
||||
BuildScript.Create(_ =>
|
||||
{
|
||||
builder.Log(Severity.Info, $"Successfully downloaded {path}");
|
||||
return 0;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,13 +23,14 @@ namespace Semmle.Autobuild.Shared
|
||||
|
||||
public abstract class ProjectOrSolution : IProjectOrSolution
|
||||
{
|
||||
public string FullPath { get; private set; }
|
||||
public string FullPath { get; }
|
||||
|
||||
public string DirectoryName => Path.GetDirectoryName(FullPath) ?? "";
|
||||
public string DirectoryName { get; }
|
||||
|
||||
protected ProjectOrSolution(Autobuilder builder, string path)
|
||||
{
|
||||
FullPath = builder.Actions.GetFullPath(path);
|
||||
DirectoryName = builder.Actions.GetDirectoryName(path) ?? "";
|
||||
}
|
||||
|
||||
public abstract IEnumerable<IProjectOrSolution> IncludedProjects { get; }
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace Semmle.BuildAnalyser
|
||||
nuget = new NugetPackages(sourceDir.FullName, PackageDirectory);
|
||||
ReadNugetFiles();
|
||||
}
|
||||
catch(FileNotFoundException)
|
||||
catch (FileNotFoundException)
|
||||
{
|
||||
progressMonitor.MissingNuGet();
|
||||
}
|
||||
@@ -97,7 +97,9 @@ namespace Semmle.BuildAnalyser
|
||||
// Find DLLs in the .Net Framework
|
||||
if (options.ScanNetFrameworkDlls)
|
||||
{
|
||||
dllDirNames.Add(Runtime.Runtimes.First());
|
||||
var runtimeLocation = Runtime.GetRuntime(options.UseSelfContainedDotnet);
|
||||
progressMonitor.Log(Util.Logging.Severity.Debug, $"Runtime location selected: {runtimeLocation}");
|
||||
dllDirNames.Add(runtimeLocation);
|
||||
}
|
||||
|
||||
// These files can sometimes prevent `dotnet restore` from working correctly.
|
||||
@@ -279,7 +281,7 @@ namespace Semmle.BuildAnalyser
|
||||
|
||||
void AnalyseProject(FileInfo project)
|
||||
{
|
||||
if(!project.Exists)
|
||||
if (!project.Exists)
|
||||
{
|
||||
progressMonitor.MissingProject(project.FullName);
|
||||
return;
|
||||
@@ -323,7 +325,7 @@ namespace Semmle.BuildAnalyser
|
||||
void Restore(string projectOrSolution)
|
||||
{
|
||||
int exit = DotNet.RestoreToDirectory(projectOrSolution, PackageDirectory.DirInfo.FullName);
|
||||
switch(exit)
|
||||
switch (exit)
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
@@ -342,7 +344,7 @@ namespace Semmle.BuildAnalyser
|
||||
|
||||
public void AnalyseSolutions(IEnumerable<string> solutions)
|
||||
{
|
||||
Parallel.ForEach(solutions, new ParallelOptions { MaxDegreeOfParallelism = 4 } , solutionFile =>
|
||||
Parallel.ForEach(solutions, new ParallelOptions { MaxDegreeOfParallelism = 4 }, solutionFile =>
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Semmle.Extraction.CSharp.Standalone
|
||||
{
|
||||
public override bool handleFlag(string key, bool value)
|
||||
{
|
||||
switch(key)
|
||||
switch (key)
|
||||
{
|
||||
case "silent":
|
||||
Verbosity = value ? Verbosity.Off : Verbosity.Info;
|
||||
@@ -36,6 +36,9 @@ namespace Semmle.Extraction.CSharp.Standalone
|
||||
case "skip-dotnet":
|
||||
ScanNetFrameworkDlls = !value;
|
||||
return true;
|
||||
case "self-contained-dotnet":
|
||||
UseSelfContainedDotnet = value;
|
||||
return true;
|
||||
default:
|
||||
return base.handleFlag(key, value);
|
||||
}
|
||||
@@ -43,7 +46,7 @@ namespace Semmle.Extraction.CSharp.Standalone
|
||||
|
||||
public override bool handleOption(string key, string value)
|
||||
{
|
||||
switch(key)
|
||||
switch (key)
|
||||
{
|
||||
case "exclude":
|
||||
Excludes.Add(value);
|
||||
@@ -134,6 +137,11 @@ namespace Semmle.Extraction.CSharp.Standalone
|
||||
/// </summary>
|
||||
public bool Help = false;
|
||||
|
||||
/// <summary>
|
||||
/// Whether to use the packaged dotnet runtime.
|
||||
/// </summary>
|
||||
public bool UseSelfContainedDotnet = false;
|
||||
|
||||
/// <summary>
|
||||
/// Determine whether the given path should be excluded.
|
||||
/// </summary>
|
||||
@@ -162,6 +170,7 @@ namespace Semmle.Extraction.CSharp.Standalone
|
||||
output.WriteLine(" --threads:nnn Specify number of threads (default=CPU cores)");
|
||||
output.WriteLine(" --verbose Produce more output");
|
||||
output.WriteLine(" --pdb Cross-reference information from PDBs where available");
|
||||
output.WriteLine(" --self-contained-dotnet Use the .Net Framework packaged with the extractor");
|
||||
}
|
||||
|
||||
private Options()
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Semmle.BuildAnalyser
|
||||
void NugetInstall(string package);
|
||||
void ResolvedReference(string filename);
|
||||
void Summary(int existingSources, int usedSources, int missingSources, int references, int unresolvedReferences, int resolvedConflicts, int totalProjects, int failedProjects, TimeSpan analysisTime);
|
||||
void Warning(string message);
|
||||
void Log(Severity severity, string message);
|
||||
void ResolvedConflict(string asm1, string asm2);
|
||||
void MissingProject(string projectFile);
|
||||
void CommandFailed(string exe, string arguments, int exitCode);
|
||||
@@ -93,9 +93,9 @@ namespace Semmle.BuildAnalyser
|
||||
logger.Log(Severity.Info, "Build analysis completed in {0}", analysisTime);
|
||||
}
|
||||
|
||||
public void Warning(string message)
|
||||
public void Log(Severity severity, string message)
|
||||
{
|
||||
logger.Log(Severity.Warning, message);
|
||||
logger.Log(severity, message);
|
||||
}
|
||||
|
||||
public void ResolvedConflict(string asm1, string asm2)
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace Semmle.Extraction.CSharp.Standalone
|
||||
/// <summary>
|
||||
/// Locates .NET Core Runtimes.
|
||||
/// </summary>
|
||||
public static IEnumerable<string> CoreRuntimes
|
||||
private static IEnumerable<string> CoreRuntimes
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -37,7 +37,7 @@ namespace Semmle.Extraction.CSharp.Standalone
|
||||
/// Locates .NET Desktop Runtimes.
|
||||
/// This includes Mono and Microsoft.NET.
|
||||
/// </summary>
|
||||
public static IEnumerable<string> DesktopRuntimes
|
||||
private static IEnumerable<string> DesktopRuntimes
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -63,7 +63,12 @@ namespace Semmle.Extraction.CSharp.Standalone
|
||||
}
|
||||
}
|
||||
|
||||
public static IEnumerable<string> Runtimes
|
||||
/// <summary>
|
||||
/// Gets the .NET runtime location to use for extraction
|
||||
/// </summary>
|
||||
public static string GetRuntime(bool useSelfContained) => useSelfContained ? ExecutingRuntime : Runtimes.First();
|
||||
|
||||
private static IEnumerable<string> Runtimes
|
||||
{
|
||||
get
|
||||
{
|
||||
|
||||
@@ -14,10 +14,10 @@ private import semmle.code.csharp.frameworks.JsonNET
|
||||
private import semmle.code.csharp.frameworks.WCF
|
||||
|
||||
/**
|
||||
* Holds if `node` should be a barrier in all global taint flow configurations
|
||||
* Holds if `node` should be a sanitizer in all global taint flow configurations
|
||||
* but not in local taint.
|
||||
*/
|
||||
predicate defaultTaintBarrier(DataFlow::Node node) { none() }
|
||||
predicate defaultTaintSanitizer(DataFlow::Node node) { none() }
|
||||
|
||||
deprecated predicate localAdditionalTaintStep = defaultAdditionalTaintStep/2;
|
||||
|
||||
|
||||
@@ -76,20 +76,20 @@ abstract class Configuration extends DataFlow::Configuration {
|
||||
|
||||
final override predicate isBarrier(DataFlow::Node node) {
|
||||
isSanitizer(node) or
|
||||
defaultTaintBarrier(node)
|
||||
defaultTaintSanitizer(node)
|
||||
}
|
||||
|
||||
/** Holds if data flow into `node` is prohibited. */
|
||||
/** Holds if taint propagation into `node` is prohibited. */
|
||||
predicate isSanitizerIn(DataFlow::Node node) { none() }
|
||||
|
||||
final override predicate isBarrierIn(DataFlow::Node node) { isSanitizerIn(node) }
|
||||
|
||||
/** Holds if data flow out of `node` is prohibited. */
|
||||
/** Holds if taint propagation out of `node` is prohibited. */
|
||||
predicate isSanitizerOut(DataFlow::Node node) { none() }
|
||||
|
||||
final override predicate isBarrierOut(DataFlow::Node node) { isSanitizerOut(node) }
|
||||
|
||||
/** Holds if data flow through nodes guarded by `guard` is prohibited. */
|
||||
/** Holds if taint propagation through nodes guarded by `guard` is prohibited. */
|
||||
predicate isSanitizerGuard(DataFlow::BarrierGuard guard) { none() }
|
||||
|
||||
final override predicate isBarrierGuard(DataFlow::BarrierGuard guard) { isSanitizerGuard(guard) }
|
||||
|
||||
@@ -76,20 +76,20 @@ abstract class Configuration extends DataFlow::Configuration {
|
||||
|
||||
final override predicate isBarrier(DataFlow::Node node) {
|
||||
isSanitizer(node) or
|
||||
defaultTaintBarrier(node)
|
||||
defaultTaintSanitizer(node)
|
||||
}
|
||||
|
||||
/** Holds if data flow into `node` is prohibited. */
|
||||
/** Holds if taint propagation into `node` is prohibited. */
|
||||
predicate isSanitizerIn(DataFlow::Node node) { none() }
|
||||
|
||||
final override predicate isBarrierIn(DataFlow::Node node) { isSanitizerIn(node) }
|
||||
|
||||
/** Holds if data flow out of `node` is prohibited. */
|
||||
/** Holds if taint propagation out of `node` is prohibited. */
|
||||
predicate isSanitizerOut(DataFlow::Node node) { none() }
|
||||
|
||||
final override predicate isBarrierOut(DataFlow::Node node) { isSanitizerOut(node) }
|
||||
|
||||
/** Holds if data flow through nodes guarded by `guard` is prohibited. */
|
||||
/** Holds if taint propagation through nodes guarded by `guard` is prohibited. */
|
||||
predicate isSanitizerGuard(DataFlow::BarrierGuard guard) { none() }
|
||||
|
||||
final override predicate isBarrierGuard(DataFlow::BarrierGuard guard) { isSanitizerGuard(guard) }
|
||||
|
||||
@@ -76,20 +76,20 @@ abstract class Configuration extends DataFlow::Configuration {
|
||||
|
||||
final override predicate isBarrier(DataFlow::Node node) {
|
||||
isSanitizer(node) or
|
||||
defaultTaintBarrier(node)
|
||||
defaultTaintSanitizer(node)
|
||||
}
|
||||
|
||||
/** Holds if data flow into `node` is prohibited. */
|
||||
/** Holds if taint propagation into `node` is prohibited. */
|
||||
predicate isSanitizerIn(DataFlow::Node node) { none() }
|
||||
|
||||
final override predicate isBarrierIn(DataFlow::Node node) { isSanitizerIn(node) }
|
||||
|
||||
/** Holds if data flow out of `node` is prohibited. */
|
||||
/** Holds if taint propagation out of `node` is prohibited. */
|
||||
predicate isSanitizerOut(DataFlow::Node node) { none() }
|
||||
|
||||
final override predicate isBarrierOut(DataFlow::Node node) { isSanitizerOut(node) }
|
||||
|
||||
/** Holds if data flow through nodes guarded by `guard` is prohibited. */
|
||||
/** Holds if taint propagation through nodes guarded by `guard` is prohibited. */
|
||||
predicate isSanitizerGuard(DataFlow::BarrierGuard guard) { none() }
|
||||
|
||||
final override predicate isBarrierGuard(DataFlow::BarrierGuard guard) { isSanitizerGuard(guard) }
|
||||
|
||||
@@ -76,20 +76,20 @@ abstract class Configuration extends DataFlow::Configuration {
|
||||
|
||||
final override predicate isBarrier(DataFlow::Node node) {
|
||||
isSanitizer(node) or
|
||||
defaultTaintBarrier(node)
|
||||
defaultTaintSanitizer(node)
|
||||
}
|
||||
|
||||
/** Holds if data flow into `node` is prohibited. */
|
||||
/** Holds if taint propagation into `node` is prohibited. */
|
||||
predicate isSanitizerIn(DataFlow::Node node) { none() }
|
||||
|
||||
final override predicate isBarrierIn(DataFlow::Node node) { isSanitizerIn(node) }
|
||||
|
||||
/** Holds if data flow out of `node` is prohibited. */
|
||||
/** Holds if taint propagation out of `node` is prohibited. */
|
||||
predicate isSanitizerOut(DataFlow::Node node) { none() }
|
||||
|
||||
final override predicate isBarrierOut(DataFlow::Node node) { isSanitizerOut(node) }
|
||||
|
||||
/** Holds if data flow through nodes guarded by `guard` is prohibited. */
|
||||
/** Holds if taint propagation through nodes guarded by `guard` is prohibited. */
|
||||
predicate isSanitizerGuard(DataFlow::BarrierGuard guard) { none() }
|
||||
|
||||
final override predicate isBarrierGuard(DataFlow::BarrierGuard guard) { isSanitizerGuard(guard) }
|
||||
|
||||
@@ -76,20 +76,20 @@ abstract class Configuration extends DataFlow::Configuration {
|
||||
|
||||
final override predicate isBarrier(DataFlow::Node node) {
|
||||
isSanitizer(node) or
|
||||
defaultTaintBarrier(node)
|
||||
defaultTaintSanitizer(node)
|
||||
}
|
||||
|
||||
/** Holds if data flow into `node` is prohibited. */
|
||||
/** Holds if taint propagation into `node` is prohibited. */
|
||||
predicate isSanitizerIn(DataFlow::Node node) { none() }
|
||||
|
||||
final override predicate isBarrierIn(DataFlow::Node node) { isSanitizerIn(node) }
|
||||
|
||||
/** Holds if data flow out of `node` is prohibited. */
|
||||
/** Holds if taint propagation out of `node` is prohibited. */
|
||||
predicate isSanitizerOut(DataFlow::Node node) { none() }
|
||||
|
||||
final override predicate isBarrierOut(DataFlow::Node node) { isSanitizerOut(node) }
|
||||
|
||||
/** Holds if data flow through nodes guarded by `guard` is prohibited. */
|
||||
/** Holds if taint propagation through nodes guarded by `guard` is prohibited. */
|
||||
predicate isSanitizerGuard(DataFlow::BarrierGuard guard) { none() }
|
||||
|
||||
final override predicate isBarrierGuard(DataFlow::BarrierGuard guard) { isSanitizerGuard(guard) }
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
@echo off
|
||||
SETLOCAL EnableDelayedExpansion
|
||||
|
||||
rem The autobuilder is already being traced
|
||||
set CODEQL_AUTOBUILDER_CSHARP_NO_INDEXING=true
|
||||
|
||||
type NUL && "%CODEQL_EXTRACTOR_CSHARP_ROOT%/tools/%CODEQL_PLATFORM%/Semmle.Autobuild.CSharp.exe" || exit /b %ERRORLEVEL%
|
||||
|
||||
ENDLOCAL
|
||||
type NUL && "%CODEQL_EXTRACTOR_CSHARP_ROOT%/tools/%CODEQL_PLATFORM%/Semmle.Autobuild.CSharp.exe"
|
||||
exit /b %ERRORLEVEL%
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user