Merge master into next.

master as of dc3c5a684c
Version numbers resolved in favour of `next`.
C++ expected output file updated to accept test output.
This commit is contained in:
Aditya Sharad
2018-10-30 17:11:17 +00:00
128 changed files with 2600 additions and 1072 deletions

View File

@@ -1,3 +1,4 @@
/csharp/ @Semmle/cs
/java/ @Semmle/java
/javascript/ @Semmle/js
/cpp/ @Semmle/cpp-analysis

View File

@@ -15,13 +15,16 @@
| **Query** | **Expected impact** | **Change** |
|----------------------------|------------------------|------------------------------------------------------------------|
| Empty branch of conditional | Fewer false positive results | The query now recognizes commented blocks more reliably. |
| Resource not released in destructor | Fewer false positive results | Placement new is now excluded from the query. Also fixed an issue where false positives could occur if the destructor body was not in the snapshot. |
| Missing return statement (`cpp/missing-return`) | Visible by default | The precision of this query has been increased from 'medium' to 'high', which makes it visible by default in LGTM. It was 'medium' in release 1.17 and 1.18 because it had false positives due to an extractor bug that was fixed in 1.18. |
| Missing return statement | Fewer false positive results | The query is now produces correct results when a function returns a template-dependent type. |
| Call to memory access function may overflow buffer | More correct results | Array indexing with a negative index is now detected by this query. |
| Suspicious call to memset | Fewer false positive results | Types involving decltype are now correctly compared. |
| Suspicious add with sizeof | Fewer false positive results | Arithmetic with void pointers (where allowed) is now excluded from this query. |
| Wrong type of arguments to formatting function | Fewer false positive results | False positive results involving typedefs have been removed. Expected argument types are determined more accurately, especially for wide string and pointer types. Custom (non-standard) formatting functions are also identified more accurately. |
## Changes to QL libraries
* Added a hash consing library for structural comparison of expressions.
* `getBufferSize` now detects variable size structs more reliably.

View File

@@ -2,8 +2,10 @@
## General improvements
* The control flow graph construction now takes simple Boolean conditions on local scope variables into account. For example, in `if (b) x = 0; if (b) x = 1;`, the control flow graph will reflect that taking the `true` (resp. `false`) branch in the first condition implies taking the same branch in the second condition. In effect, the first assignment to `x` will now be identified as being dead.
* Control flow graph improvements:
* The control flow graph construction now takes simple Boolean conditions on local scope variables into account. For example, in `if (b) x = 0; if (b) x = 1;`, the control flow graph will reflect that taking the `true` (resp. `false`) branch in the first condition implies taking the same branch in the second condition. In effect, the first assignment to `x` will now be identified as being dead.
* Code that is only reachable from a constant failing assertion, such as `Debug.Assert(false)`, is considered to be unreachable.
## New queries
| **Query** | **Tags** | **Purpose** |
@@ -13,7 +15,7 @@
## Changes to existing queries
| Inconsistent lock sequence (`cs/inconsistent-lock-sequence`) | More results | This query now finds inconsistent lock sequences globally across calls. |
| Local scope variable shadows member (`cs/local-shadows-member`) | Fewer results | Results have been removed where a constructor parameter shadows a member, because the parameter is probably used to initialize the member. |
| *@name of query (Query ID)*| *Impact on results* | *How/why the query has changed* |

View File

@@ -6,16 +6,23 @@
| **Query** | **Tags** | **Purpose** |
|-----------------------------|-----------|--------------------------------------------------------------------|
| Missing catch of NumberFormatException (`java/uncaught-number-format-exception`) | reliability, external/cwe/cwe-248 | Finds calls to `Integer.parseInt` and similar string-to-number conversions that might raise a `NumberFormatException` without a corresponding `catch`-clause. |
## Changes to existing queries
| **Query** | **Expected impact** | **Change** |
|----------------------------|------------------------|------------------------------------------------------------------|
| Array index out of bounds (`java/index-out-of-bounds`) | Fewer false positive results | False positives involving arrays with a length evenly divisible by 3 or some greater number and an index being increased with a similar stride length are no longer reported. |
| Query built from user-controlled sources (`java/sql-injection`) | More results | Sql injection sinks from the Spring JDBC, MyBatis, and Hibernate frameworks are now reported. |
| Query built without neutralizing special characters (`java/concatenated-sql-query`) | More results | Sql injection sinks from the Spring JDBC, MyBatis, and Hibernate frameworks are now reported. |
| Unreachable catch clause (`java/unreachable-catch-clause`) | Fewer false positive results | This rule now accounts for calls to generic methods that throw generic exceptions. |
| Useless comparison test (`java/constant-comparison`) | Fewer false positive results | Constant comparisons guarding `java.util.ConcurrentModificationException` are no longer reported, as they are intended to always be false in the absence of API misuse. |
## Changes to QL libraries
* The default set of taint sources in the `FlowSources` library is extended to
cover parameters annotated with Spring framework annotations indicating
remote user input from servlets. This affects all security queries, which
will yield additional results on projects using the Spring Web framework.
* The `ParityAnalysis` library is replaced with the more general `ModulusAnalysis` library, which improves the range analysis.

View File

@@ -38,6 +38,7 @@
| Unused variable, import, function or class | Fewer results | This rule now flags import statements with multiple unused imports once. |
| User-controlled bypass of security check | Fewer results | This rule no longer flags conditions that guard early returns. The precision of this rule has been revised to "medium". Results are no longer shown on LGTM by default. |
| Whitespace contradicts operator precedence | Fewer false-positive results | This rule no longer flags operators with asymmetric whitespace. |
| Unused import | Fewer false-positive results | This rule no longer flags imports used by the `transform-react-jsx` Babel plugin. |
## Changes to QL libraries

View File

@@ -29,6 +29,10 @@ class AffectedFile extends File {
}
}
/**
* A block, or an element we might find textually within a block that is
* not a child of it in the AST.
*/
class BlockOrNonChild extends Element {
BlockOrNonChild() {
( this instanceof Block
@@ -68,6 +72,9 @@ class BlockOrNonChild extends Element {
}
}
/**
* A block that contains a non-child element.
*/
predicate emptyBlockContainsNonchild(Block b) {
emptyBlock(_, b) and
exists(BlockOrNonChild c, AffectedFile file |
@@ -78,7 +85,27 @@ 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) {
emptyBlock(_, b) and
exists(Location bLocation, File f, int line |
bLocation = b.getLocation() and
f = bLocation.getFile() and
line = bLocation.getStartLine() and
line = bLocation.getEndLine() and
exists(Comment c, Location cLocation |
cLocation = c.getLocation() and
cLocation.getFile() = f and
cLocation.getStartLine() = line
)
)
}
from ControlStructure s, Block eb
where emptyBlock(s, eb)
and not emptyBlockContainsNonchild(eb)
and not lineComment(eb)
select eb, "Empty block without comment"

View File

@@ -48,6 +48,7 @@ where exists
ctls.getControllingExpr() = e1
and e1.getType().(TypedefType).hasName("HRESULT")
and not isHresultBooleanConverted(e1)
and not ctls instanceof SwitchStmt // not controlled by a boolean condition
and msg = "Direct usage of a type " + e1.getType().toString() + " as a conditional expression"
)
or

View File

@@ -25,7 +25,7 @@ predicate pointerThis(Expr e) {
// `f(...)`
// (includes `this = ...`, where `=` is overloaded so a `FunctionCall`)
exists(FunctionCall fc | fc = e and callOnThis(fc) |
exists(fc.getTarget().getBlock()) implies returnsPointerThis(fc.getTarget())
returnsPointerThis(fc.getTarget())
) or
// `this = ...` (where `=` is not overloaded, so an `AssignExpr`)
@@ -38,22 +38,33 @@ predicate dereferenceThis(Expr e) {
// `f(...)`
// (includes `*this = ...`, where `=` is overloaded so a `FunctionCall`)
exists(FunctionCall fc | fc = e and callOnThis(fc) |
exists(fc.getTarget().getBlock()) implies returnsDereferenceThis(fc.getTarget())
returnsDereferenceThis(fc.getTarget())
) or
// `*this = ...` (where `=` is not overloaded, so an `AssignExpr`)
dereferenceThis(e.(AssignExpr).getLValue())
}
/**
* Holds if all `return` statements in `f` return `this`, possibly indirectly.
* This includes functions whose body is not in the database.
*/
predicate returnsPointerThis(Function f) {
forex(ReturnStmt s | s.getEnclosingFunction() = f |
f.getType().getUnspecifiedType() instanceof PointerType and
forall(ReturnStmt s | s.getEnclosingFunction() = f and reachable(s) |
// `return this`
pointerThis(s.getExpr())
)
}
/**
* Holds if all `return` statements in `f` return a reference to `*this`,
* possibly indirectly. This includes functions whose body is not in the
* database.
*/
predicate returnsDereferenceThis(Function f) {
forex(ReturnStmt s | s.getEnclosingFunction() = f |
f.getType().getUnspecifiedType() instanceof ReferenceType and
forall(ReturnStmt s | s.getEnclosingFunction() = f and reachable(s) |
// `return *this`
dereferenceThis(s.getExpr())
)
@@ -72,7 +83,6 @@ predicate assignOperatorWithWrongType(Operator op, string msg) {
predicate assignOperatorWithWrongResult(Operator op, string msg) {
op.hasName("operator=")
and not returnsDereferenceThis(op)
and exists(op.getBlock())
and not op.getType() instanceof VoidType
and not assignOperatorWithWrongType(op, _)
and msg = "Assignment operator in class " + op.getDeclaringType().getName() + " does not return a reference to *this."

View File

@@ -1,29 +1,6 @@
import cpp
import semmle.code.cpp.dataflow.DataFlow
/**
* Holds if `sizeof(s)` occurs as part of the parameter of a dynamic
* memory allocation (`malloc`, `realloc`, etc.), except if `sizeof(s)`
* only ever occurs as the immediate parameter to allocations.
*
* For example, holds for `s` if it occurs as
* ```
* malloc(sizeof(s) + 100 * sizeof(char))
* ```
* but not if it only ever occurs as
* ```
* malloc(sizeof(s))
* ```
*/
private predicate isDynamicallyAllocatedWithDifferentSize(Class s) {
exists(SizeofTypeOperator sof |
sof.getTypeOperand().getUnspecifiedType() = s |
// Check all ancestor nodes except the immediate parent for
// allocations.
isStdLibAllocationExpr(sof.getParent().(Expr).getParent+())
)
}
/**
* Holds if `v` is a member variable of `c` that looks like it might be variable sized in practice. For
* example:
@@ -34,15 +11,40 @@ private predicate isDynamicallyAllocatedWithDifferentSize(Class s) {
* };
* ```
* This requires that `v` is an array of size 0 or 1, and `v` is the last member of `c`. In addition,
* there must be at least one instance where a `c` pointer is allocated with additional space.
* there must be at least one instance where a `c` pointer is allocated with additional space. For
* example, holds for `c` if it occurs as
* ```
* malloc(sizeof(c) + 100 * sizeof(char))
* ```
* but not if it only ever occurs as
* ```
* malloc(sizeof(c))
* ```
*/
predicate memberMayBeVarSize(Class c, MemberVariable v) {
exists(int i |
// `v` is the last field in `c`
i = max(int j | c.getCanonicalMember(j) instanceof Field | j) and
v = c.getCanonicalMember(i) and
v.getType().getUnspecifiedType().(ArrayType).getSize() <= 1
) and
isDynamicallyAllocatedWithDifferentSize(c)
// v is an array of size at most 1
v.getType().getUnspecifiedType().(ArrayType).getArraySize() <= 1
) and (
exists(SizeofOperator so |
// `sizeof(c)` is taken
so.(SizeofTypeOperator).getTypeOperand().getUnspecifiedType() = c or
so.(SizeofExprOperator).getExprOperand().getType().getUnspecifiedType() = c |
// arithmetic is performed on the result
so.getParent*() instanceof AddExpr
) or exists(AddressOfExpr aoe |
// `&(c.v)` is taken
aoe.getAddressable() = v
) or exists(BuiltInOperationOffsetOf oo |
// `offsetof(c, v)` using a builtin
oo.getAChild().(VariableAccess).getTarget() = v
)
)
}
/**
@@ -81,19 +83,21 @@ int getBufferSize(Expr bufferExpr, Element why) {
// buffer is a fixed size dynamic allocation
isFixedSizeAllocationExpr(bufferExpr, result) and
why = bufferExpr
) or (
) or exists(DataFlow::ExprNode bufferExprNode |
// dataflow (all sources must be the same size)
bufferExprNode = DataFlow::exprNode(bufferExpr) and
result = min(Expr def |
DataFlow::localFlowStep(DataFlow::exprNode(def), DataFlow::exprNode(bufferExpr)) |
DataFlow::localFlowStep(DataFlow::exprNode(def), bufferExprNode) |
getBufferSize(def, _)
) and result = max(Expr def |
DataFlow::localFlowStep(DataFlow::exprNode(def), DataFlow::exprNode(bufferExpr)) |
DataFlow::localFlowStep(DataFlow::exprNode(def), bufferExprNode) |
getBufferSize(def, _)
) and
// find reason
exists(Expr def |
DataFlow::localFlowStep(DataFlow::exprNode(def), DataFlow::exprNode(bufferExpr)) |
DataFlow::localFlowStep(DataFlow::exprNode(def), bufferExprNode) |
why = def or
exists(getBufferSize(def, why))
)

View File

@@ -124,11 +124,17 @@ cached library class SSAHelper extends int {
* Modern Compiler Implementation by Andrew Appel.
*/
private predicate frontier_phi_node(LocalScopeVariable v, BasicBlock b) {
exists(BasicBlock x | dominanceFrontier(x, b) and ssa_defn(v, _, x, _))
exists(BasicBlock x | dominanceFrontier(x, b) and ssa_defn_rec(v, x))
/* We can also eliminate those nodes where the variable is not live on any incoming edge */
and live_at_start_of_bb(v, b)
}
private predicate ssa_defn_rec(LocalScopeVariable v, BasicBlock b) {
phi_node(v, b)
or
variableUpdate(v, _, b, _)
}
/**
* Holds if `v` is defined, for the purpose of SSA, at `node`, which is at
* position `index` in block `b`. This includes definitions from phi nodes.

View File

@@ -293,6 +293,61 @@ predicate analyzableDef(RangeSsaDefinition def, LocalScopeVariable v) {
assignmentDef(def, v, _) or defDependsOnDef(def, v, _, _)
}
/**
* Computes a normal form of `x` where -0.0 has changed to +0.0. This can be
* needed on the lesser side of a floating-point comparison or on both sides of
* a floating point equality because QL does not follow IEEE in floating-point
* comparisons but instead defines -0.0 to be less than and distinct from 0.0.
*/
bindingset[x]
private float normalizeFloatUp(float x) {
result = x + 0.0
}
/**
* Computes `x + y`, rounded towards +Inf. This is the general case where both
* `x` and `y` may be large numbers.
*/
bindingset[x, y]
private float addRoundingUp(float x, float y) {
if normalizeFloatUp((x + y) - x) < y or normalizeFloatUp((x + y) - y) < x
then result = (x + y).nextUp()
else result = (x + y)
}
/**
* Computes `x + y`, rounded towards -Inf. This is the general case where both
* `x` and `y` may be large numbers.
*/
bindingset[x, y]
private float addRoundingDown(float x, float y) {
if (x + y) - x > normalizeFloatUp(y) or (x + y) - y > normalizeFloatUp(x)
then result = (x + y).nextDown()
else result = (x + y)
}
/**
* Computes `x + small`, rounded towards +Inf, where `small` is a small
* constant.
*/
bindingset[x, small]
private float addRoundingUpSmall(float x, float small) {
if (x + small) - x < small
then result = (x + small).nextUp()
else result = (x + small)
}
/**
* Computes `x + small`, rounded towards -Inf, where `small` is a small
* constant.
*/
bindingset[x, small]
private float addRoundingDownSmall(float x, float small) {
if (x + small) - x > small
then result = (x + small).nextDown()
else result = (x + small)
}
/**
* Gets the truncated lower bounds of the fully converted expression.
*/
@@ -470,13 +525,13 @@ float getLowerBoundsImpl(Expr expr) {
| expr = addExpr and
xLow = getFullyConvertedLowerBounds(addExpr.getLeftOperand()) and
yLow = getFullyConvertedLowerBounds(addExpr.getRightOperand()) and
result = xLow+yLow)
result = addRoundingDown(xLow, yLow))
or
exists (SubExpr subExpr, float xLow, float yHigh
| expr = subExpr and
xLow = getFullyConvertedLowerBounds(subExpr.getLeftOperand()) and
yHigh = getFullyConvertedUpperBounds(subExpr.getRightOperand()) and
result = xLow-yHigh)
result = addRoundingDown(xLow, -yHigh))
or
exists (PrefixIncrExpr incrExpr, float xLow
| expr = incrExpr and
@@ -486,7 +541,7 @@ float getLowerBoundsImpl(Expr expr) {
exists (PrefixDecrExpr decrExpr, float xLow
| expr = decrExpr and
xLow = getFullyConvertedLowerBounds(decrExpr.getOperand()) and
result = xLow-1)
result = addRoundingDownSmall(xLow, -1))
or
// `PostfixIncrExpr` and `PostfixDecrExpr` return the value of their
// operand. The incrementing/decrementing behavior is handled in
@@ -592,18 +647,18 @@ float getUpperBoundsImpl(Expr expr) {
| expr = addExpr and
xHigh = getFullyConvertedUpperBounds(addExpr.getLeftOperand()) and
yHigh = getFullyConvertedUpperBounds(addExpr.getRightOperand()) and
result = xHigh+yHigh)
result = addRoundingUp(xHigh, yHigh))
or
exists (SubExpr subExpr, float xHigh, float yLow
| expr = subExpr and
xHigh = getFullyConvertedUpperBounds(subExpr.getLeftOperand()) and
yLow = getFullyConvertedLowerBounds(subExpr.getRightOperand()) and
result = xHigh-yLow)
result = addRoundingUp(xHigh, -yLow))
or
exists (PrefixIncrExpr incrExpr, float xHigh
| expr = incrExpr and
xHigh = getFullyConvertedUpperBounds(incrExpr.getOperand()) and
result = xHigh+1)
result = addRoundingUpSmall(xHigh, 1))
or
exists (PrefixDecrExpr decrExpr, float xHigh
| expr = decrExpr and
@@ -796,7 +851,7 @@ float getDefLowerBoundsImpl(RangeSsaDefinition def, LocalScopeVariable v) {
assignAdd.getLValue() = nextDef.getAUse(v) and
lhsLB = getDefLowerBounds(nextDef, v) and
rhsLB = getFullyConvertedLowerBounds(assignAdd.getRValue()) and
result = lhsLB + rhsLB)
result = addRoundingDown(lhsLB, rhsLB))
or
exists (
AssignSubExpr assignSub, RangeSsaDefinition nextDef, float lhsLB, float rhsUB
@@ -804,7 +859,7 @@ float getDefLowerBoundsImpl(RangeSsaDefinition def, LocalScopeVariable v) {
assignSub.getLValue() = nextDef.getAUse(v) and
lhsLB = getDefLowerBounds(nextDef, v) and
rhsUB = getFullyConvertedUpperBounds(assignSub.getRValue()) and
result = lhsLB - rhsUB)
result = addRoundingDown(lhsLB, -rhsUB))
or
exists (IncrementOperation incr, float newLB
| def = incr and
@@ -816,7 +871,7 @@ float getDefLowerBoundsImpl(RangeSsaDefinition def, LocalScopeVariable v) {
| def = decr and
decr.getOperand() = v.getAnAccess() and
newLB = getFullyConvertedLowerBounds(decr.getOperand()) and
result = newLB-1)
result = addRoundingDownSmall(newLB, -1))
or
// Phi nodes.
result = getPhiLowerBounds(v, def)
@@ -839,7 +894,7 @@ float getDefUpperBoundsImpl(RangeSsaDefinition def, LocalScopeVariable v) {
assignAdd.getLValue() = nextDef.getAUse(v) and
lhsUB = getDefUpperBounds(nextDef, v) and
rhsUB = getFullyConvertedUpperBounds(assignAdd.getRValue()) and
result = lhsUB + rhsUB)
result = addRoundingUp(lhsUB, rhsUB))
or
exists (
AssignSubExpr assignSub, RangeSsaDefinition nextDef, float lhsUB, float rhsLB
@@ -847,13 +902,13 @@ float getDefUpperBoundsImpl(RangeSsaDefinition def, LocalScopeVariable v) {
assignSub.getLValue() = nextDef.getAUse(v) and
lhsUB = getDefUpperBounds(nextDef, v) and
rhsLB = getFullyConvertedLowerBounds(assignSub.getRValue()) and
result = lhsUB - rhsLB)
result = addRoundingUp(lhsUB, -rhsLB))
or
exists (IncrementOperation incr, float newUB
| def = incr and
incr.getOperand() = v.getAnAccess() and
newUB = getFullyConvertedUpperBounds(incr.getOperand()) and
result = newUB+1)
result = addRoundingUpSmall(newUB, 1))
or
exists (DecrementOperation decr, float newUB
| def = decr and

View File

@@ -1,30 +1,30 @@
| copy_from_prototype.cpp:3:7:3:7 | a | a<int>::a(a<int> &&) | copy_from_prototype.cpp:3:7:3:7 | a<int> | <no expr> |
| copy_from_prototype.cpp:3:7:3:7 | a | a<int>::a(const a<int> &) | copy_from_prototype.cpp:3:7:3:7 | a<int> | <no expr> |
| copy_from_prototype.cpp:3:7:3:7 | operator= | a<int>::operator=(a<int> &&) | copy_from_prototype.cpp:3:7:3:7 | a<int> | <no expr> |
| copy_from_prototype.cpp:3:7:3:7 | operator= | a<int>::operator=(const a<int> &) | copy_from_prototype.cpp:3:7:3:7 | a<int> | <no expr> |
| copy_from_prototype.cpp:4:26:4:26 | a | a<<unnamed>>::a<(unnamed)>() | copy_from_prototype.cpp:3:7:3:7 | a<<unnamed>> | 123 |
| copy_from_prototype.cpp:4:26:4:26 | a | a<int>::a<(unnamed)>() | copy_from_prototype.cpp:3:7:3:7 | a<int> | <no expr> |
| copy_from_prototype.cpp:7:7:7:7 | b | b::b() | copy_from_prototype.cpp:7:7:7:7 | b | <no expr> |
| copy_from_prototype.cpp:7:7:7:7 | b | b::b(b &&) | copy_from_prototype.cpp:7:7:7:7 | b | <no expr> |
| copy_from_prototype.cpp:7:7:7:7 | b | b::b(const b &) | copy_from_prototype.cpp:7:7:7:7 | b | <no expr> |
| copy_from_prototype.cpp:7:7:7:7 | operator= | b::operator=(b &&) | copy_from_prototype.cpp:7:7:7:7 | b | <no expr> |
| copy_from_prototype.cpp:7:7:7:7 | operator= | b::operator=(const b &) | copy_from_prototype.cpp:7:7:7:7 | b | <no expr> |
| copy_from_prototype.cpp:13:7:13:7 | c | c<int>::c(c<int> &&) | copy_from_prototype.cpp:13:7:13:7 | c<int> | <no expr> |
| copy_from_prototype.cpp:13:7:13:7 | c | c<int>::c(const c<int> &) | copy_from_prototype.cpp:13:7:13:7 | c<int> | <no expr> |
| copy_from_prototype.cpp:13:7:13:7 | operator= | c<int>::operator=(c<int> &&) | copy_from_prototype.cpp:13:7:13:7 | c<int> | <no expr> |
| copy_from_prototype.cpp:13:7:13:7 | operator= | c<int>::operator=(const c<int> &) | copy_from_prototype.cpp:13:7:13:7 | c<int> | <no expr> |
| copy_from_prototype.cpp:14:26:14:26 | c | c<T>::c<(unnamed)>() | copy_from_prototype.cpp:13:7:13:7 | c<T> | Unknown literal |
| copy_from_prototype.cpp:14:26:14:26 | c | c<int>::c<(unnamed)>() | copy_from_prototype.cpp:13:7:13:7 | c<int> | <no expr> |
| copy_from_prototype.cpp:17:7:17:7 | d | d::d() | copy_from_prototype.cpp:17:7:17:7 | d | <no expr> |
| copy_from_prototype.cpp:17:7:17:7 | d | d::d(const d &) | copy_from_prototype.cpp:17:7:17:7 | d | <no expr> |
| copy_from_prototype.cpp:17:7:17:7 | d | d::d(d &&) | copy_from_prototype.cpp:17:7:17:7 | d | <no expr> |
| copy_from_prototype.cpp:17:7:17:7 | operator= | d::operator=(const d &) | copy_from_prototype.cpp:17:7:17:7 | d | <no expr> |
| copy_from_prototype.cpp:17:7:17:7 | operator= | d::operator=(d &&) | copy_from_prototype.cpp:17:7:17:7 | d | <no expr> |
| copy_from_prototype.cpp:22:8:22:8 | e | e<int>::e(const e<int> &) | copy_from_prototype.cpp:22:8:22:8 | e<int> | <no expr> |
| copy_from_prototype.cpp:22:8:22:8 | e | e<int>::e(e<int> &&) | copy_from_prototype.cpp:22:8:22:8 | e<int> | <no expr> |
| copy_from_prototype.cpp:22:8:22:8 | operator= | e<int>::operator=(const e<int> &) | copy_from_prototype.cpp:22:8:22:8 | e<int> | <no expr> |
| copy_from_prototype.cpp:22:8:22:8 | operator= | e<int>::operator=(e<int> &&) | copy_from_prototype.cpp:22:8:22:8 | e<int> | <no expr> |
| copy_from_prototype.cpp:23:26:23:26 | e | e<T>::e<(unnamed)>() | copy_from_prototype.cpp:22:8:22:8 | e<T> | 456 |
| copy_from_prototype.cpp:26:35:26:43 | e | e<int>::e<(unnamed)>() | copy_from_prototype.cpp:22:8:22:8 | e<int> | 456 |
| file://:0:0:0:0 | operator= | __va_list_tag::operator=(__va_list_tag &&) | file://:0:0:0:0 | __va_list_tag | <none> |
| file://:0:0:0:0 | operator= | __va_list_tag::operator=(const __va_list_tag &) | file://:0:0:0:0 | __va_list_tag | <none> |
| copy_from_prototype.cpp:3:7:3:7 | a | a<int>::a(a<int> &&) -> void | copy_from_prototype.cpp:3:7:3:7 | a<int> | <no expr> |
| copy_from_prototype.cpp:3:7:3:7 | a | a<int>::a(const a<int> &) -> void | copy_from_prototype.cpp:3:7:3:7 | a<int> | <no expr> |
| copy_from_prototype.cpp:3:7:3:7 | operator= | a<int>::operator=(a<int> &&) -> a<int> & | copy_from_prototype.cpp:3:7:3:7 | a<int> | <no expr> |
| copy_from_prototype.cpp:3:7:3:7 | operator= | a<int>::operator=(const a<int> &) -> a<int> & | copy_from_prototype.cpp:3:7:3:7 | a<int> | <no expr> |
| copy_from_prototype.cpp:4:26:4:26 | a | a<<unnamed>>::a<(unnamed)>() -> void | copy_from_prototype.cpp:3:7:3:7 | a<<unnamed>> | 123 |
| copy_from_prototype.cpp:4:26:4:26 | a | a<int>::a<(unnamed)>() -> void | copy_from_prototype.cpp:3:7:3:7 | a<int> | <no expr> |
| copy_from_prototype.cpp:7:7:7:7 | b | b::b() -> void | copy_from_prototype.cpp:7:7:7:7 | b | <no expr> |
| copy_from_prototype.cpp:7:7:7:7 | b | b::b(b &&) -> void | copy_from_prototype.cpp:7:7:7:7 | b | <no expr> |
| copy_from_prototype.cpp:7:7:7:7 | b | b::b(const b &) -> void | copy_from_prototype.cpp:7:7:7:7 | b | <no expr> |
| copy_from_prototype.cpp:7:7:7:7 | operator= | b::operator=(b &&) -> b & | copy_from_prototype.cpp:7:7:7:7 | b | <no expr> |
| copy_from_prototype.cpp:7:7:7:7 | operator= | b::operator=(const b &) -> b & | copy_from_prototype.cpp:7:7:7:7 | b | <no expr> |
| copy_from_prototype.cpp:13:7:13:7 | c | c<int>::c(c<int> &&) -> void | copy_from_prototype.cpp:13:7:13:7 | c<int> | <no expr> |
| copy_from_prototype.cpp:13:7:13:7 | c | c<int>::c(const c<int> &) -> void | copy_from_prototype.cpp:13:7:13:7 | c<int> | <no expr> |
| copy_from_prototype.cpp:13:7:13:7 | operator= | c<int>::operator=(c<int> &&) -> c<int> & | copy_from_prototype.cpp:13:7:13:7 | c<int> | <no expr> |
| copy_from_prototype.cpp:13:7:13:7 | operator= | c<int>::operator=(const c<int> &) -> c<int> & | copy_from_prototype.cpp:13:7:13:7 | c<int> | <no expr> |
| copy_from_prototype.cpp:14:26:14:26 | c | c<T>::c<(unnamed)>() -> void | copy_from_prototype.cpp:13:7:13:7 | c<T> | Unknown literal |
| copy_from_prototype.cpp:14:26:14:26 | c | c<int>::c<(unnamed)>() -> void | copy_from_prototype.cpp:13:7:13:7 | c<int> | <no expr> |
| copy_from_prototype.cpp:17:7:17:7 | d | d::d() -> void | copy_from_prototype.cpp:17:7:17:7 | d | <no expr> |
| copy_from_prototype.cpp:17:7:17:7 | d | d::d(const d &) -> void | copy_from_prototype.cpp:17:7:17:7 | d | <no expr> |
| copy_from_prototype.cpp:17:7:17:7 | d | d::d(d &&) -> void | copy_from_prototype.cpp:17:7:17:7 | d | <no expr> |
| copy_from_prototype.cpp:17:7:17:7 | operator= | d::operator=(const d &) -> d & | copy_from_prototype.cpp:17:7:17:7 | d | <no expr> |
| copy_from_prototype.cpp:17:7:17:7 | operator= | d::operator=(d &&) -> d & | copy_from_prototype.cpp:17:7:17:7 | d | <no expr> |
| copy_from_prototype.cpp:22:8:22:8 | e | e<int>::e(const e<int> &) -> void | copy_from_prototype.cpp:22:8:22:8 | e<int> | <no expr> |
| copy_from_prototype.cpp:22:8:22:8 | e | e<int>::e(e<int> &&) -> void | copy_from_prototype.cpp:22:8:22:8 | e<int> | <no expr> |
| copy_from_prototype.cpp:22:8:22:8 | operator= | e<int>::operator=(const e<int> &) -> e<int> & | copy_from_prototype.cpp:22:8:22:8 | e<int> | <no expr> |
| copy_from_prototype.cpp:22:8:22:8 | operator= | e<int>::operator=(e<int> &&) -> e<int> & | copy_from_prototype.cpp:22:8:22:8 | e<int> | <no expr> |
| copy_from_prototype.cpp:23:26:23:26 | e | e<T>::e<(unnamed)>() -> void | copy_from_prototype.cpp:22:8:22:8 | e<T> | 456 |
| copy_from_prototype.cpp:26:35:26:43 | e | e<int>::e<(unnamed)>() -> void | copy_from_prototype.cpp:22:8:22:8 | e<int> | 456 |
| file://:0:0:0:0 | operator= | __va_list_tag::operator=(__va_list_tag &&) -> __va_list_tag & | file://:0:0:0:0 | __va_list_tag | <none> |
| file://:0:0:0:0 | operator= | __va_list_tag::operator=(const __va_list_tag &) -> __va_list_tag & | file://:0:0:0:0 | __va_list_tag | <none> |

View File

@@ -1,19 +1,9 @@
import cpp
string functionName(Function f) {
exists(string name, string templateArgs, string args |
result = name + templateArgs + args
and name = f.getQualifiedName()
and if exists(f.getATemplateArgument())
then templateArgs = "<" + concat(int i | exists(f.getTemplateArgument(i)) | f.getTemplateArgument(i).toString(), "," order by i) + ">"
else templateArgs = ""
and args = "(" + concat(int i | exists(f.getParameter(i)) | f.getParameter(i).getType().toString(), "," order by i) + ")")
}
from Function f, string e
where if f.hasExceptionSpecification()
then if exists(f.getADeclarationEntry().getNoExceptExpr())
then e = f.getADeclarationEntry().getNoExceptExpr().toString()
else e = "<no expr>"
else e = "<none>"
select f, functionName(f), f.getDeclaringType(), e
select f, f.getFullSignature(), f.getDeclaringType(), e

View File

@@ -48,4 +48,10 @@ int f(int x) {
// GOOD (no block)
for (;;) ;
// GOOD (has comment): [FALSE POSITIVE]
if (x) {} // comment
// GOOD (has comment): [FALSE POSITIVE]
if (x) {} // comment
}

View File

@@ -57,3 +57,12 @@ static int foo(size_t *size)
if (*size <= MAX_VAL) // BAD (pointless comparison) [NO LONGER REPORTED]
*size = MAX_VAL;
}
// ODASA-7205
int regression_test_01(unsigned long bb) {
if (bb + 1 == 0) { // GOOD [NO LONGER REPORTED]
return 0;
} else {
return 1;
}
}

View File

@@ -97,4 +97,26 @@ void IncorrectTypeConversionTest() {
{
// ...
}
if (HresultFunction() == S_FALSE) // Correct Usage
{
// ...
}
while (!HresultFunction()) {}; // BUG
while (FAILED(HresultFunction())) {}; // Correct Usage
switch(hr) // Correct Usage
{
case S_OK:
case S_FALSE:
{
// ...
} break;
default:
{
// ...
} break;
}
}

View File

@@ -94,4 +94,26 @@ void IncorrectTypeConversionTest() {
{
// ...
}
if (HresultFunction() == S_FALSE) // Correct Usage
{
// ...
}
while (!HresultFunction()) {}; // BUG
while (FAILED(HresultFunction())) {}; // Correct Usage
switch(hr) // Correct Usage
{
case S_OK:
case S_FALSE:
{
// ...
} break;
default:
{
// ...
} break;
}
}

View File

@@ -8,6 +8,7 @@
| HResultBooleanConversion.c:79:15:79:38 | call to IncorrectHresultFunction | Implicit conversion from HRESULT to bool |
| HResultBooleanConversion.c:82:10:82:11 | hr | Usage of a type HRESULT as an argument of a unary logical operation |
| HResultBooleanConversion.c:92:9:92:10 | hr | Direct usage of a type HRESULT as a conditional expression |
| HResultBooleanConversion.c:106:13:106:27 | call to HresultFunction | Usage of a type HRESULT as an argument of a unary logical operation |
| HResultBooleanConversion.cpp:39:12:39:23 | call to BoolFunction | Implicit conversion from BOOL to HRESULT |
| HResultBooleanConversion.cpp:44:12:44:24 | call to BoolFunction2 | Implicit conversion from bool to HRESULT |
| HResultBooleanConversion.cpp:50:15:50:16 | hr | Explicit conversion from HRESULT to BOOL |
@@ -18,3 +19,4 @@
| HResultBooleanConversion.cpp:76:15:76:38 | call to IncorrectHresultFunction | Implicit conversion from HRESULT to bool |
| HResultBooleanConversion.cpp:79:10:79:11 | hr | Implicit conversion from HRESULT to bool |
| HResultBooleanConversion.cpp:89:9:89:10 | hr | Implicit conversion from HRESULT to bool |
| HResultBooleanConversion.cpp:103:13:103:27 | call to HresultFunction | Implicit conversion from HRESULT to bool |

View File

@@ -112,6 +112,65 @@ private:
int val;
};
struct Exception {
virtual ~Exception();
};
class AlwaysThrows {
public:
AlwaysThrows &operator=(int _val) { // GOOD (always throws)
throw Exception();
// No `return` statement is generated by the C++ front end because it can
// statically see that the end of the function is unreachable.
}
AlwaysThrows &operator=(int *_val) { // GOOD (always throws)
int one = 1;
if (one)
throw Exception();
// A `return` statement is generated by the C++ front end, but the
// control-flow pruning in QL will establish that this is unreachable.
}
};
class Reachability {
Reachability &operator=(Reachability &that) { // GOOD
int one = 1;
if (one)
return *this;
else
return that; // unreachable
}
// helper function that always returns a reference to `*this`.
Reachability &returnThisReference() {
int one = 1;
if (one)
return *this;
else
return staticInstance; // unreachable
}
// helper function that always returns `this`.
Reachability *const returnThisPointer() {
int one = 1;
if (one)
return this;
else
return &staticInstance; // unreachable
}
Reachability &operator=(int _val) { // GOOD
return returnThisReference();
}
Reachability &operator=(short _val) { // GOOD
return *returnThisPointer();
}
static Reachability staticInstance;
};
int main() {
Container c;
c = c;

View File

@@ -62,9 +62,9 @@ namespace Semmle.Extraction.CIL.Entities
}
}
public void Extract(Context cx)
public void Extract(Context cx2)
{
cx.Populate(this);
cx2.Populate(this);
}
TrapStackBehaviour IEntity.TrapStackBehaviour => TrapStackBehaviour.NoLabel;

View File

@@ -60,7 +60,7 @@ namespace Semmle.Extraction.CIL.Entities
Location IEntity.ReportingLocation => throw new NotImplementedException();
public void Extract(Context cx) { cx.Populate(this); }
public void Extract(Context cx2) { cx2.Populate(this); }
public abstract IEnumerable<IExtractionProduct> Contents { get; }
@@ -83,13 +83,13 @@ namespace Semmle.Extraction.CIL.Entities
/// <summary>
/// Find the method in this type matching the name and signature.
/// </summary>
/// <param name="Name">The handle to the name.</param>
/// <param name="methodName">The handle to the name.</param>
/// <param name="signature">
/// The handle to the signature. Note that comparing handles is a valid
/// shortcut to comparing the signature bytes since handles are unique.
/// </param>
/// <returns>The method, or 'null' if not found or not supported.</returns>
internal virtual Method LookupMethod(StringHandle Name, BlobHandle signature)
internal virtual Method LookupMethod(StringHandle methodName, BlobHandle signature)
{
return null;
}
@@ -338,16 +338,16 @@ namespace Semmle.Extraction.CIL.Entities
if (ThisTypeParameters == 0)
return Enumerable.Empty<TypeTypeParameter>();
var typeParams = new TypeTypeParameter[ThisTypeParameters];
var newTypeParams = new TypeTypeParameter[ThisTypeParameters];
var genericParams = td.GetGenericParameters();
int toSkip = genericParams.Count - typeParams.Length;
int toSkip = genericParams.Count - newTypeParams.Length;
// Two-phase population because type parameters can be mutually dependent
for (int i = 0; i < typeParams.Length; ++i)
typeParams[i] = cx.Populate(new TypeTypeParameter(this, this, i));
for (int i = 0; i < typeParams.Length; ++i)
typeParams[i].PopulateHandle(this, genericParams[i + toSkip]);
return typeParams;
for (int i = 0; i < newTypeParams.Length; ++i)
newTypeParams[i] = cx.Populate(new TypeTypeParameter(this, this, i));
for (int i = 0; i < newTypeParams.Length; ++i)
newTypeParams[i].PopulateHandle(this, genericParams[i + toSkip]);
return newTypeParams;
}
readonly Lazy<IEnumerable<TypeTypeParameter>> typeParams;
@@ -482,12 +482,12 @@ namespace Semmle.Extraction.CIL.Entities
TypeTypeParameter[] MakeTypeParameters()
{
var typeParams = new TypeTypeParameter[ThisTypeParameters];
for (int i = 0; i < typeParams.Length; ++i)
var newTypeParams = new TypeTypeParameter[ThisTypeParameters];
for (int i = 0; i < newTypeParams.Length; ++i)
{
typeParams[i] = new TypeTypeParameter(this, this, i);
newTypeParams[i] = new TypeTypeParameter(this, this, i);
}
return typeParams;
return newTypeParams;
}
public override IEnumerable<IExtractionProduct> Contents

View File

@@ -49,9 +49,9 @@ namespace Semmle.Extraction.CIL
public virtual IId Id => FreshId.Instance;
public virtual void Extract(Context cx)
public virtual void Extract(Context cx2)
{
cx.Extract(this);
cx2.Extract(this);
}
public readonly Context cx;
@@ -79,9 +79,9 @@ namespace Semmle.Extraction.CIL
public abstract Id IdSuffix { get; }
public IId Id => ShortId + IdSuffix;
public void Extract(Context cx)
public void Extract(Context cx2)
{
cx.Populate(this);
cx2.Populate(this);
}
public readonly Context cx;

View File

@@ -21,7 +21,7 @@ namespace Semmle.Extraction.CSharp.Entities
// existence of a syntax tree. This is not the case for compiled
// attributes.
var syntax = attribute.ApplicationSyntaxReference.GetSyntax() as AttributeSyntax;
ExtractAttribute(cx, syntax, attribute.AttributeClass, entity);
ExtractAttribute(syntax, attribute.AttributeClass, entity);
}
}
@@ -29,10 +29,10 @@ namespace Semmle.Extraction.CSharp.Entities
: base(cx)
{
var info = cx.GetSymbolInfo(attribute);
ExtractAttribute(cx, attribute, info.Symbol.ContainingType, entity);
ExtractAttribute(attribute, info.Symbol.ContainingType, entity);
}
void ExtractAttribute(Context cx, AttributeSyntax syntax, ITypeSymbol attributeClass, IEntity entity)
void ExtractAttribute(AttributeSyntax syntax, ITypeSymbol attributeClass, IEntity entity)
{
var type = Type.Create(cx, attributeClass);
cx.Emit(Tuples.attributes(this, type.TypeRef, entity));

View File

@@ -202,13 +202,13 @@ namespace Semmle.Extraction.CSharp.Entities
cx.Emit(Tuples.conditional_access(this));
}
public void PopulateArguments(Context cx, BaseArgumentListSyntax args, int child)
public void PopulateArguments(BaseArgumentListSyntax args, int child)
{
foreach (var arg in args.Arguments)
PopulateArgument(cx, arg, child++);
PopulateArgument(arg, child++);
}
private void PopulateArgument(Context cx, ArgumentSyntax arg, int child)
private void PopulateArgument(ArgumentSyntax arg, int child)
{
var expr = Create(cx, arg.Expression, this, child);
int mode;

View File

@@ -27,7 +27,7 @@ namespace Semmle.Extraction.CSharp.Entities.Expressions
var add = new Expression(new ExpressionInfo(cx, qualifierInfo.Type, Location, ExprKind.ADD, this, 0, false, null));
qualifierInfo.SetParent(add, 0);
CreateFromNode(qualifierInfo);
PopulateArguments(cx, ArgumentList, 1);
PopulateArguments(ArgumentList, 1);
}
else
{

View File

@@ -22,7 +22,7 @@ namespace Semmle.Extraction.CSharp.Entities.Expressions
{
if (IsNameof(Syntax))
{
PopulateArguments(cx, Syntax.ArgumentList, 0);
PopulateArguments(Syntax.ArgumentList, 0);
return;
}
@@ -80,7 +80,7 @@ namespace Semmle.Extraction.CSharp.Entities.Expressions
cx.ModelError(Syntax, "Unable to get name for dynamic call.");
}
PopulateArguments(cx, Syntax.ArgumentList, child);
PopulateArguments(Syntax.ArgumentList, child);
if (target == null)
{

View File

@@ -14,7 +14,7 @@ namespace Semmle.Extraction.CSharp.Entities.Expressions
protected override void Populate() { }
void VisitParameter(Context cx, ParameterSyntax p)
void VisitParameter(ParameterSyntax p)
{
var symbol = cx.Model(p).GetDeclaredSymbol(p);
Parameter.Create(cx, symbol, this);
@@ -27,7 +27,7 @@ namespace Semmle.Extraction.CSharp.Entities.Expressions
cx.PopulateLater(() =>
{
foreach (var param in @params)
VisitParameter(cx, param);
VisitParameter(param);
if (body is ExpressionSyntax)
Create(cx, (ExpressionSyntax)body, this, 0);

View File

@@ -37,7 +37,7 @@ namespace Semmle.Extraction.CSharp.Entities.Expressions
{
if (Syntax.ArgumentList != null)
{
PopulateArguments(cx, Syntax.ArgumentList, 0);
PopulateArguments(Syntax.ArgumentList, 0);
}
var target = cx.Model(Syntax).GetSymbolInfo(Syntax);

View File

@@ -29,11 +29,6 @@ namespace Semmle.Extraction.CSharp.Entities
}
}
public void Extract(Context cx, NamespaceDeclarationSyntax decl)
{
decl.Accept(new Populators.TypeOrNamespaceVisitor(cx, this));
}
public static NamespaceDeclaration Create(Context cx, NamespaceDeclarationSyntax decl, NamespaceDeclaration parent) => new NamespaceDeclaration(cx, decl, parent);
public override TrapStackBehaviour TrapStackBehaviour => TrapStackBehaviour.NoLabel;

View File

@@ -38,6 +38,8 @@ private predicate acceptableShadowing(LocalScopeVariable v, Member m) {
ma.targetIsLocalInstance() and
not ma.getQualifier().isImplicit()
)
or
t.getAConstructor().getAParameter() = v
)
}

View File

@@ -1,11 +1,20 @@
/** Provides classes for assertions. */
private import semmle.code.csharp.frameworks.system.Diagnostics
private import semmle.code.csharp.frameworks.test.VisualStudio
private import semmle.code.csharp.frameworks.System
/** An assertion method. */
abstract class AssertMethod extends Method {
/** Gets the index of the parameter being asserted. */
abstract int getAssertionIndex();
/** Gets the parameter being asserted. */
final Parameter getAssertedParameter() {
result = this.getParameter(this.getAssertionIndex())
}
/** Gets the exception being thrown if the assertion fails, if any. */
abstract ExceptionClass getExceptionClass();
}
/** A positive assertion method. */
@@ -24,6 +33,36 @@ abstract class AssertNullMethod extends AssertMethod {
abstract class AssertNonNullMethod extends AssertMethod {
}
/** An assertion, that is, a call to an assertion method. */
class Assertion extends MethodCall {
private AssertMethod target;
Assertion() { this.getTarget() = target }
/** Gets the assertion method targeted by this assertion. */
AssertMethod getAssertMethod() { result = target }
/** Gets the expression that this assertion pertains to. */
Expr getExpr() {
result = this.getArgumentForParameter(target.getAssertedParameter())
}
}
/** A trivially failing assertion, for example `Debug.Assert(false)`. */
class FailingAssertion extends Assertion {
FailingAssertion() {
exists(AssertMethod am, Expr e |
am = this.getAssertMethod() and
e = this.getExpr() |
am instanceof AssertTrueMethod and
e.getValue() = "false"
or
am instanceof AssertFalseMethod and
e.getValue() = "true"
)
}
}
/**
* A `System.Diagnostics.Debug` assertion method.
*/
@@ -33,6 +72,12 @@ class SystemDiagnosticsDebugAssertTrueMethod extends AssertTrueMethod {
}
override int getAssertionIndex() { result = 0 }
override ExceptionClass getExceptionClass() {
// A failing assertion generates a message box, see
// https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.debug.assert
none()
}
}
/** A Visual Studio assertion method. */
@@ -42,6 +87,8 @@ class VSTestAssertTrueMethod extends AssertTrueMethod {
}
override int getAssertionIndex() { result = 0 }
override AssertFailedExceptionClass getExceptionClass() { any() }
}
/** A Visual Studio negated assertion method. */
@@ -51,6 +98,8 @@ class VSTestAssertFalseMethod extends AssertFalseMethod {
}
override int getAssertionIndex() { result = 0 }
override AssertFailedExceptionClass getExceptionClass() { any() }
}
/** A Visual Studio `null` assertion method. */
@@ -60,6 +109,8 @@ class VSTestAssertNullMethod extends AssertNullMethod {
}
override int getAssertionIndex() { result = 0 }
override AssertFailedExceptionClass getExceptionClass() { any() }
}
/** A Visual Studio non-`null` assertion method. */
@@ -69,26 +120,51 @@ class VSTestAssertNonNullMethod extends AssertNonNullMethod {
}
override int getAssertionIndex() { result = 0 }
override AssertFailedExceptionClass getExceptionClass() { any() }
}
/** A method that forwards to another assertion method. */
class ForwarderAssertMethod extends AssertMethod {
AssertMethod forwardee;
int assertionIndex;
Assertion a;
Parameter p;
ForwarderAssertMethod() {
exists(AssignableDefinitions::ImplicitParameterDefinition def, ParameterRead pr |
def.getParameter() = this.getParameter(assertionIndex) and
pr = def.getAReachableRead() and
pr.getAControlFlowNode().postDominates(this.getEntryPoint()) and
forwardee.getParameter(forwardee.getAssertionIndex()).getAnAssignedArgument() = pr
p = this.getAParameter() and
strictcount(AssignableDefinition def | def.getTarget() = p) = 1 and
forex(ControlFlowElement body |
body = this.getABody() |
bodyAsserts(this, body, a) and
a.getExpr() = p.getAnAccess()
)
}
override int getAssertionIndex() { result = assertionIndex }
override int getAssertionIndex() { result = p.getPosition() }
override ExceptionClass getExceptionClass() {
result = this.getUnderlyingAssertMethod().getExceptionClass()
}
/** Gets the underlying assertion method that is being forwarded to. */
AssertMethod getUnderlyingAssertMethod() { result = forwardee }
AssertMethod getUnderlyingAssertMethod() { result = a.getAssertMethod() }
}
pragma[noinline]
private predicate bodyAsserts(Callable c, ControlFlowElement body, Assertion a) {
c.getABody() = body and
body = getAnAssertingElement(a)
}
private ControlFlowElement getAnAssertingElement(Assertion a) {
result = a
or
result = getAnAssertingStmt(a)
}
private Stmt getAnAssertingStmt(Assertion a) {
result.(ExprStmt).getExpr() = getAnAssertingElement(a)
or
result.(BlockStmt).getFirstStmt() = getAnAssertingElement(a)
}
/** A method that forwards to a positive assertion method. */
@@ -121,8 +197,5 @@ class ForwarderAssertNonNullMethod extends ForwarderAssertMethod, AssertNonNullM
/** Holds if expression `e` appears in an assertion. */
predicate isExprInAssertion(Expr e) {
exists(MethodCall call, AssertMethod assertMethod |
call.getTarget() = assertMethod |
e = call.getArgument(assertMethod.getAssertionIndex()).getAChildExpr*()
)
e = any(Assertion a).getExpr().getAChildExpr*()
}

View File

@@ -59,6 +59,8 @@ private newtype TCompletion =
TGotoDefaultCompletion()
or
TThrowCompletion(ExceptionClass ec)
or
TExitCompletion()
/**
* A completion of a statement or an expression.
@@ -642,3 +644,16 @@ class ThrowCompletion extends Completion, TThrowCompletion {
override string toString() { result = "throw(" + getExceptionClass() + ")" }
}
/**
* A completion that represents evaluation of a statement or an
* expression resulting in a program exit, for example
* `System.Environment.Exit(0)`.
*
* An exit completion is different from a `return` completion; the former
* exits the whole application, and exists inside `try` statements skip
* `finally` blocks.
*/
class ExitCompletion extends Completion, TExitCompletion {
override string toString() { result = "exit" }
}

View File

@@ -785,6 +785,30 @@ module ControlFlow {
c.(ThrowCompletion).getExceptionClass() = getExceptionClass()
}
}
/**
* An exit control flow successor.
*
* Example:
*
* ```
* int M(string s)
* {
* if (s == null)
* System.Environment.Exit(0);
* return s.Length;
* }
* ```
*
* The callable exit node of `M` is an exit successor of the node on line 4.
*/
class ExitSuccessor extends SuccessorType, TExitSuccessor {
override string toString() { result = "exit" }
override predicate matchesCompletion(Completion c) {
c instanceof ExitCompletion
}
}
}
private import SuccessorTypes
@@ -1386,10 +1410,15 @@ module ControlFlow {
result = lastTryStmtFinally(ts, c) and
not c instanceof NormalCompletion
or
// If there is no `finally` block, last elements are from the body, from
// the blocks of one of the `catch` clauses, or from the last `catch` clause
not ts.hasFinally() and
result = getBlockOrCatchFinallyPred(ts, c)
result = getBlockOrCatchFinallyPred(ts, c) and
(
// If there is no `finally` block, last elements are from the body, from
// the blocks of one of the `catch` clauses, or from the last `catch` clause
not ts.hasFinally()
or
// Exit completions ignore the `finally` block
c instanceof ExitCompletion
)
)
or
cfe = any(SpecificCatchClause scc |
@@ -1453,7 +1482,7 @@ module ControlFlow {
// Propagate completion from a call to a non-terminating callable
cfe = any(NonReturningCall nrc |
result = nrc and
c = nrc.getTarget().(NonReturningCallable).getACallCompletion()
c = nrc.getACompletion()
)
}
@@ -1734,19 +1763,44 @@ module ControlFlow {
*/
private module NonReturning {
private import semmle.code.csharp.ExprOrStmtParent
private import semmle.code.csharp.commons.Assertions
private import semmle.code.csharp.frameworks.System
/**
* A call that definitely does not return (conservative analysis).
*/
class NonReturningCall extends Call {
NonReturningCall() {
this.getTarget() instanceof NonReturningCallable
}
/** A call that definitely does not return (conservative analysis). */
abstract class NonReturningCall extends Call {
/** Gets a valid completion for this non-returning call. */
abstract Completion getACompletion();
}
/** A callable that does not return. */
abstract class NonReturningCallable extends Callable {
private class ExitingCall extends NonReturningCall {
ExitingCall() {
this.getTarget() instanceof ExitingCallable
or
exists(AssertMethod m |
m = this.(FailingAssertion).getAssertMethod() |
not exists(m.getExceptionClass())
)
}
override ExitCompletion getACompletion() { any() }
}
private class ThrowingCall extends NonReturningCall {
private ThrowCompletion c;
ThrowingCall() {
c = this.getTarget().(ThrowingCallable).getACallCompletion()
or
exists(AssertMethod m |
m = this.(FailingAssertion).getAssertMethod() |
c.getExceptionClass() = m.getExceptionClass()
)
}
override ThrowCompletion getACompletion() { result = c }
}
private abstract class NonReturningCallable extends Callable {
NonReturningCallable() {
not exists(ReturnStmt ret | ret.getEnclosingCallable() = this) and
not hasAccessorAutoImplementation(this, _) and
@@ -1756,19 +1810,9 @@ module ControlFlow {
v = this.(Accessor).getDeclaration()
)
}
/** Gets a valid completion for a call to this non-returning callable. */
abstract Completion getACallCompletion();
}
/**
* A callable that exits when called.
*/
private abstract class ExitingCallable extends NonReturningCallable {
override Completion getACallCompletion() {
result instanceof ReturnCompletion
}
}
private abstract class ExitingCallable extends NonReturningCallable { }
private class DirectlyExitingCallable extends ExitingCallable {
DirectlyExitingCallable() {
@@ -1789,7 +1833,8 @@ module ControlFlow {
}
private ControlFlowElement getAnExitingElement() {
result.(Call).getTarget() instanceof ExitingCallable or
result instanceof ExitingCall
or
result = getAnExitingStmt()
}
@@ -1805,9 +1850,6 @@ module ControlFlow {
)
}
/**
* A callable that throws an exception when called.
*/
private class ThrowingCallable extends NonReturningCallable {
ThrowingCallable() {
forex(ControlFlowElement body |
@@ -1816,16 +1858,17 @@ module ControlFlow {
)
}
override ThrowCompletion getACallCompletion() {
/** Gets a valid completion for a call to this throwing callable. */
ThrowCompletion getACallCompletion() {
this.getABody() = getAThrowingElement(result)
}
}
private ControlFlowElement getAThrowingElement(ThrowCompletion c) {
c = result.(Call).getTarget().(ThrowingCallable).getACallCompletion()
c = result.(ThrowingCall).getACompletion()
or
result = any(ThrowElement te |
c.(ThrowCompletion).getExceptionClass() = te.getThrownExceptionType() and
c.getExceptionClass() = te.getThrownExceptionType() and
// For stub implementations, there may exist proper implementations that are not seen
// during compilation, so we conservatively rule those out
not isStub(te)
@@ -1839,12 +1882,13 @@ module ControlFlow {
or
result.(BlockStmt).getFirstStmt() = getAThrowingStmt(c)
or
exists(IfStmt ifStmt |
exists(IfStmt ifStmt, ThrowCompletion c1, ThrowCompletion c2 |
result = ifStmt and
ifStmt.getThen() = getAThrowingElement(_) and
ifStmt.getElse() = getAThrowingElement(_) |
ifStmt.getThen() = getAThrowingElement(c) or
ifStmt.getElse() = getAThrowingElement(c)
ifStmt.getThen() = getAThrowingElement(c1) and
ifStmt.getElse() = getAThrowingElement(c2) |
c = c1
or
c = c2
)
}
@@ -2293,6 +2337,7 @@ module ControlFlow {
// Flow from last element of `try` block to first element of `finally` block
cfe = lastTryStmtBlock(ts, c) and
result = first(ts.getFinally()) and
not c instanceof ExitCompletion and
(
c instanceof ThrowCompletion
implies
@@ -3892,6 +3937,8 @@ module ControlFlow {
TExceptionSuccessor(ExceptionClass ec) {
exists(ThrowCompletion c | c.getExceptionClass() = ec)
}
or
TExitSuccessor()
/** Gets a successor node of a given flow type, if any. */
cached

View File

@@ -107,6 +107,14 @@ class VSTestAssertClass extends Class {
}
}
/** The `Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException` class. */
class AssertFailedExceptionClass extends ExceptionClass {
AssertFailedExceptionClass() {
this.getNamespace() instanceof VSTestNamespace and
this.hasName("AssertFailedException")
}
}
/** DEPRECATED. Gets the `Microsoft.VisualStudio.TestTools.UnitTesting.Assert` class. */
deprecated
VSTestAssertClass getVSTestAssertClass() { any() }

View File

@@ -0,0 +1,84 @@
| Assertions.cs:7:44:7:59 | call to method IsTrue | Assertions.cs:7:58:7:58 | access to parameter b | NonConstructedMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:7:44:7:59 | call to method IsTrue | Assertions.cs:7:58:7:58 | access to parameter b | RuntimeMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:7:44:7:59 | call to method IsTrue | Assertions.cs:7:58:7:58 | access to parameter b | SourceDeclarationMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:7:44:7:59 | call to method IsTrue | Assertions.cs:7:58:7:58 | access to parameter b | VSTestAssertTrueMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:8:45:8:55 | call to method MyAssert | Assertions.cs:8:54:8:54 | access to parameter b | ForwarderAssertTrueMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:8:45:8:55 | call to method MyAssert | Assertions.cs:8:54:8:54 | access to parameter b | NonConstructedMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:8:45:8:55 | call to method MyAssert | Assertions.cs:8:54:8:54 | access to parameter b | RuntimeMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:8:45:8:55 | call to method MyAssert | Assertions.cs:8:54:8:54 | access to parameter b | SourceDeclarationMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:16:9:16:31 | call to method Assert | Assertions.cs:16:22:16:30 | ... != ... | NonConstructedMethod | <none> |
| Assertions.cs:16:9:16:31 | call to method Assert | Assertions.cs:16:22:16:30 | ... != ... | RuntimeMethod | <none> |
| Assertions.cs:16:9:16:31 | call to method Assert | Assertions.cs:16:22:16:30 | ... != ... | SourceDeclarationMethod | <none> |
| Assertions.cs:16:9:16:31 | call to method Assert | Assertions.cs:16:22:16:30 | ... != ... | SystemDiagnosticsDebugAssertTrueMethod | <none> |
| Assertions.cs:17:9:17:24 | call to method IsNull | Assertions.cs:17:23:17:23 | access to local variable s | NonConstructedMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:17:9:17:24 | call to method IsNull | Assertions.cs:17:23:17:23 | access to local variable s | RuntimeMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:17:9:17:24 | call to method IsNull | Assertions.cs:17:23:17:23 | access to local variable s | SourceDeclarationMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:17:9:17:24 | call to method IsNull | Assertions.cs:17:23:17:23 | access to local variable s | VSTestAssertNullMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:18:9:18:27 | call to method IsNotNull | Assertions.cs:18:26:18:26 | access to local variable s | NonConstructedMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:18:9:18:27 | call to method IsNotNull | Assertions.cs:18:26:18:26 | access to local variable s | RuntimeMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:18:9:18:27 | call to method IsNotNull | Assertions.cs:18:26:18:26 | access to local variable s | SourceDeclarationMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:18:9:18:27 | call to method IsNotNull | Assertions.cs:18:26:18:26 | access to local variable s | VSTestAssertNonNullMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:19:9:19:32 | call to method IsTrue | Assertions.cs:19:23:19:31 | ... == ... | NonConstructedMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:19:9:19:32 | call to method IsTrue | Assertions.cs:19:23:19:31 | ... == ... | RuntimeMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:19:9:19:32 | call to method IsTrue | Assertions.cs:19:23:19:31 | ... == ... | SourceDeclarationMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:19:9:19:32 | call to method IsTrue | Assertions.cs:19:23:19:31 | ... == ... | VSTestAssertTrueMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:20:9:20:32 | call to method IsTrue | Assertions.cs:20:23:20:31 | ... != ... | NonConstructedMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:20:9:20:32 | call to method IsTrue | Assertions.cs:20:23:20:31 | ... != ... | RuntimeMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:20:9:20:32 | call to method IsTrue | Assertions.cs:20:23:20:31 | ... != ... | SourceDeclarationMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:20:9:20:32 | call to method IsTrue | Assertions.cs:20:23:20:31 | ... != ... | VSTestAssertTrueMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:21:9:21:33 | call to method IsFalse | Assertions.cs:21:24:21:32 | ... != ... | NonConstructedMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:21:9:21:33 | call to method IsFalse | Assertions.cs:21:24:21:32 | ... != ... | RuntimeMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:21:9:21:33 | call to method IsFalse | Assertions.cs:21:24:21:32 | ... != ... | SourceDeclarationMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:21:9:21:33 | call to method IsFalse | Assertions.cs:21:24:21:32 | ... != ... | VSTestAssertFalseMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:22:9:22:33 | call to method IsFalse | Assertions.cs:22:24:22:32 | ... == ... | NonConstructedMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:22:9:22:33 | call to method IsFalse | Assertions.cs:22:24:22:32 | ... == ... | RuntimeMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:22:9:22:33 | call to method IsFalse | Assertions.cs:22:24:22:32 | ... == ... | SourceDeclarationMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:22:9:22:33 | call to method IsFalse | Assertions.cs:22:24:22:32 | ... == ... | VSTestAssertFalseMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:23:9:23:38 | call to method MyAssert | Assertions.cs:23:29:23:37 | ... == ... | ForwarderAssertTrueMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:23:9:23:38 | call to method MyAssert | Assertions.cs:23:29:23:37 | ... == ... | NonConstructedMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:23:9:23:38 | call to method MyAssert | Assertions.cs:23:29:23:37 | ... == ... | RuntimeMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:23:9:23:38 | call to method MyAssert | Assertions.cs:23:29:23:37 | ... == ... | SourceDeclarationMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:24:9:24:39 | call to method MyAssert2 | Assertions.cs:24:30:24:38 | ... == ... | ForwarderAssertTrueMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:24:9:24:39 | call to method MyAssert2 | Assertions.cs:24:30:24:38 | ... == ... | NonConstructedMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:24:9:24:39 | call to method MyAssert2 | Assertions.cs:24:30:24:38 | ... == ... | RuntimeMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:24:9:24:39 | call to method MyAssert2 | Assertions.cs:24:30:24:38 | ... == ... | SourceDeclarationMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:29:9:29:27 | call to method Assert | Assertions.cs:29:22:29:26 | false | NonConstructedMethod | <none> |
| Assertions.cs:29:9:29:27 | call to method Assert | Assertions.cs:29:22:29:26 | false | RuntimeMethod | <none> |
| Assertions.cs:29:9:29:27 | call to method Assert | Assertions.cs:29:22:29:26 | false | SourceDeclarationMethod | <none> |
| Assertions.cs:29:9:29:27 | call to method Assert | Assertions.cs:29:22:29:26 | false | SystemDiagnosticsDebugAssertTrueMethod | <none> |
| Assertions.cs:30:9:30:26 | call to method Assert | Assertions.cs:30:22:30:25 | true | NonConstructedMethod | <none> |
| Assertions.cs:30:9:30:26 | call to method Assert | Assertions.cs:30:22:30:25 | true | RuntimeMethod | <none> |
| Assertions.cs:30:9:30:26 | call to method Assert | Assertions.cs:30:22:30:25 | true | SourceDeclarationMethod | <none> |
| Assertions.cs:30:9:30:26 | call to method Assert | Assertions.cs:30:22:30:25 | true | SystemDiagnosticsDebugAssertTrueMethod | <none> |
| Assertions.cs:31:9:31:28 | call to method IsTrue | Assertions.cs:31:23:31:27 | false | NonConstructedMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:31:9:31:28 | call to method IsTrue | Assertions.cs:31:23:31:27 | false | RuntimeMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:31:9:31:28 | call to method IsTrue | Assertions.cs:31:23:31:27 | false | SourceDeclarationMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:31:9:31:28 | call to method IsTrue | Assertions.cs:31:23:31:27 | false | VSTestAssertTrueMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:32:9:32:27 | call to method IsTrue | Assertions.cs:32:23:32:26 | true | NonConstructedMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:32:9:32:27 | call to method IsTrue | Assertions.cs:32:23:32:26 | true | RuntimeMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:32:9:32:27 | call to method IsTrue | Assertions.cs:32:23:32:26 | true | SourceDeclarationMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:32:9:32:27 | call to method IsTrue | Assertions.cs:32:23:32:26 | true | VSTestAssertTrueMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:33:9:33:28 | call to method IsFalse | Assertions.cs:33:24:33:27 | true | NonConstructedMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:33:9:33:28 | call to method IsFalse | Assertions.cs:33:24:33:27 | true | RuntimeMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:33:9:33:28 | call to method IsFalse | Assertions.cs:33:24:33:27 | true | SourceDeclarationMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:33:9:33:28 | call to method IsFalse | Assertions.cs:33:24:33:27 | true | VSTestAssertFalseMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:34:9:34:29 | call to method IsFalse | Assertions.cs:34:24:34:28 | false | NonConstructedMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:34:9:34:29 | call to method IsFalse | Assertions.cs:34:24:34:28 | false | RuntimeMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:34:9:34:29 | call to method IsFalse | Assertions.cs:34:24:34:28 | false | SourceDeclarationMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:34:9:34:29 | call to method IsFalse | Assertions.cs:34:24:34:28 | false | VSTestAssertFalseMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:35:9:35:34 | call to method MyAssert | Assertions.cs:35:29:35:33 | false | ForwarderAssertTrueMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:35:9:35:34 | call to method MyAssert | Assertions.cs:35:29:35:33 | false | NonConstructedMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:35:9:35:34 | call to method MyAssert | Assertions.cs:35:29:35:33 | false | RuntimeMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:35:9:35:34 | call to method MyAssert | Assertions.cs:35:29:35:33 | false | SourceDeclarationMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:36:9:36:33 | call to method MyAssert | Assertions.cs:36:29:36:32 | true | ForwarderAssertTrueMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:36:9:36:33 | call to method MyAssert | Assertions.cs:36:29:36:32 | true | NonConstructedMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:36:9:36:33 | call to method MyAssert | Assertions.cs:36:29:36:32 | true | RuntimeMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:36:9:36:33 | call to method MyAssert | Assertions.cs:36:29:36:32 | true | SourceDeclarationMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:37:9:37:35 | call to method MyAssert2 | Assertions.cs:37:30:37:34 | false | ForwarderAssertTrueMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:37:9:37:35 | call to method MyAssert2 | Assertions.cs:37:30:37:34 | false | NonConstructedMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:37:9:37:35 | call to method MyAssert2 | Assertions.cs:37:30:37:34 | false | RuntimeMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:37:9:37:35 | call to method MyAssert2 | Assertions.cs:37:30:37:34 | false | SourceDeclarationMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:38:9:38:34 | call to method MyAssert2 | Assertions.cs:38:30:38:33 | true | ForwarderAssertTrueMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:38:9:38:34 | call to method MyAssert2 | Assertions.cs:38:30:38:33 | true | NonConstructedMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:38:9:38:34 | call to method MyAssert2 | Assertions.cs:38:30:38:33 | true | RuntimeMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |
| Assertions.cs:38:9:38:34 | call to method MyAssert2 | Assertions.cs:38:30:38:33 | true | SourceDeclarationMethod | Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException |

View File

@@ -0,0 +1,42 @@
using System;
using System.Diagnostics;
using Microsoft.VisualStudio.TestTools.UnitTesting;
public static class Forwarders
{
public static void MyAssert(bool b) => Assert.IsTrue(b);
public static void MyAssert2(bool b) => MyAssert(b);
}
class Assertions
{
void M()
{
string s = null;
Debug.Assert(s != null);
Assert.IsNull(s);
Assert.IsNotNull(s);
Assert.IsTrue(s == null);
Assert.IsTrue(s != null);
Assert.IsFalse(s != null);
Assert.IsFalse(s == null);
Forwarders.MyAssert(s == null);
Forwarders.MyAssert2(s == null);
}
void Trivial()
{
Debug.Assert(false);
Debug.Assert(true);
Assert.IsTrue(false);
Assert.IsTrue(true);
Assert.IsFalse(true);
Assert.IsFalse(false);
Forwarders.MyAssert(false);
Forwarders.MyAssert(true);
Forwarders.MyAssert2(false);
Forwarders.MyAssert2(true);
}
}
// semmle-extractor-options: ${testdir}/../../../resources/stubs/Microsoft.VisualStudio.TestTools.UnitTesting.cs

View File

@@ -0,0 +1,5 @@
| Assertions.cs:29:9:29:27 | call to method Assert |
| Assertions.cs:31:9:31:28 | call to method IsTrue |
| Assertions.cs:33:9:33:28 | call to method IsFalse |
| Assertions.cs:35:9:35:34 | call to method MyAssert |
| Assertions.cs:37:9:37:35 | call to method MyAssert2 |

View File

@@ -0,0 +1,4 @@
import csharp
import semmle.code.csharp.commons.Assertions
select any(FailingAssertion fa)

View File

@@ -164,35 +164,39 @@
| Conditions.cs:108:13:109:24 | [b (line 102): false] if (...) ... | Conditions.cs:109:17:109:23 | ... = ... | 9 |
| Conditions.cs:108:13:109:24 | [b (line 102): true] if (...) ... | Conditions.cs:108:18:108:18 | [b (line 102): true] access to parameter b | 3 |
| Conditions.cs:110:16:110:16 | access to local variable x | Conditions.cs:102:12:102:13 | exit M8 | 3 |
| ExitMethods.cs:6:10:6:11 | enter M1 | ExitMethods.cs:6:10:6:11 | exit M1 | 7 |
| ExitMethods.cs:12:10:12:11 | enter M2 | ExitMethods.cs:12:10:12:11 | exit M2 | 7 |
| ExitMethods.cs:18:10:18:11 | enter M3 | ExitMethods.cs:18:10:18:11 | exit M3 | 6 |
| ExitMethods.cs:24:10:24:11 | enter M4 | ExitMethods.cs:24:10:24:11 | exit M4 | 6 |
| ExitMethods.cs:30:10:30:11 | enter M5 | ExitMethods.cs:30:10:30:11 | exit M5 | 6 |
| ExitMethods.cs:36:10:36:11 | enter M6 | ExitMethods.cs:40:13:40:30 | call to method ErrorAlways | 7 |
| ExitMethods.cs:36:10:36:11 | exit M6 | ExitMethods.cs:36:10:36:11 | exit M6 | 1 |
| ExitMethods.cs:42:9:45:9 | [exception: ArgumentException] catch (...) {...} | ExitMethods.cs:42:9:45:9 | [exception: ArgumentException] catch (...) {...} | 1 |
| ExitMethods.cs:42:9:45:9 | [exception: Exception] catch (...) {...} | ExitMethods.cs:42:9:45:9 | [exception: Exception] catch (...) {...} | 1 |
| ExitMethods.cs:43:9:45:9 | {...} | ExitMethods.cs:44:13:44:19 | return ...; | 2 |
| ExitMethods.cs:46:9:49:9 | [exception: Exception] catch (...) {...} | ExitMethods.cs:48:13:48:19 | return ...; | 3 |
| ExitMethods.cs:52:17:52:26 | enter ErrorMaybe | ExitMethods.cs:54:13:54:13 | access to parameter b | 4 |
| ExitMethods.cs:52:17:52:26 | exit ErrorMaybe | ExitMethods.cs:52:17:52:26 | exit ErrorMaybe | 1 |
| ExitMethods.cs:55:19:55:33 | object creation of type Exception | ExitMethods.cs:55:13:55:34 | throw ...; | 2 |
| ExitMethods.cs:58:17:58:27 | enter ErrorAlways | ExitMethods.cs:60:13:60:13 | access to parameter b | 4 |
| ExitMethods.cs:58:17:58:27 | exit ErrorAlways | ExitMethods.cs:58:17:58:27 | exit ErrorAlways | 1 |
| ExitMethods.cs:61:19:61:33 | object creation of type Exception | ExitMethods.cs:61:13:61:34 | throw ...; | 2 |
| ExitMethods.cs:63:41:63:43 | "b" | ExitMethods.cs:63:13:63:45 | throw ...; | 3 |
| ExitMethods.cs:66:10:66:13 | enter Exit | ExitMethods.cs:66:10:66:13 | exit Exit | 6 |
| ExitMethods.cs:71:10:71:24 | enter ApplicationExit | ExitMethods.cs:71:10:71:24 | exit ApplicationExit | 5 |
| ExitMethods.cs:76:13:76:21 | enter ThrowExpr | ExitMethods.cs:78:16:78:25 | ... != ... | 7 |
| ExitMethods.cs:76:13:76:21 | exit ThrowExpr | ExitMethods.cs:76:13:76:21 | exit ThrowExpr | 1 |
| ExitMethods.cs:78:29:78:29 | 1 | ExitMethods.cs:78:9:78:77 | return ...; | 5 |
| ExitMethods.cs:78:69:78:75 | "input" | ExitMethods.cs:78:41:78:76 | throw ... | 3 |
| ExitMethods.cs:81:16:81:34 | enter ExtensionMethodCall | ExitMethods.cs:83:16:83:30 | call to method Contains | 6 |
| ExitMethods.cs:83:9:83:39 | return ...; | ExitMethods.cs:81:16:81:34 | exit ExtensionMethodCall | 2 |
| ExitMethods.cs:83:34:83:34 | 0 | ExitMethods.cs:83:34:83:34 | 0 | 1 |
| ExitMethods.cs:83:38:83:38 | 1 | ExitMethods.cs:83:38:83:38 | 1 | 1 |
| ExitMethods.cs:91:28:91:31 | enter Exit | ExitMethods.cs:91:28:91:31 | exit Exit | 3 |
| ExitMethods.cs:7:10:7:11 | enter M1 | ExitMethods.cs:7:10:7:11 | exit M1 | 7 |
| ExitMethods.cs:13:10:13:11 | enter M2 | ExitMethods.cs:13:10:13:11 | exit M2 | 7 |
| ExitMethods.cs:19:10:19:11 | enter M3 | ExitMethods.cs:19:10:19:11 | exit M3 | 6 |
| ExitMethods.cs:25:10:25:11 | enter M4 | ExitMethods.cs:25:10:25:11 | exit M4 | 6 |
| ExitMethods.cs:31:10:31:11 | enter M5 | ExitMethods.cs:31:10:31:11 | exit M5 | 6 |
| ExitMethods.cs:37:10:37:11 | enter M6 | ExitMethods.cs:41:13:41:30 | call to method ErrorAlways | 7 |
| ExitMethods.cs:37:10:37:11 | exit M6 | ExitMethods.cs:37:10:37:11 | exit M6 | 1 |
| ExitMethods.cs:43:9:46:9 | [exception: ArgumentException] catch (...) {...} | ExitMethods.cs:43:9:46:9 | [exception: ArgumentException] catch (...) {...} | 1 |
| ExitMethods.cs:43:9:46:9 | [exception: Exception] catch (...) {...} | ExitMethods.cs:43:9:46:9 | [exception: Exception] catch (...) {...} | 1 |
| ExitMethods.cs:44:9:46:9 | {...} | ExitMethods.cs:45:13:45:19 | return ...; | 2 |
| ExitMethods.cs:47:9:50:9 | [exception: Exception] catch (...) {...} | ExitMethods.cs:49:13:49:19 | return ...; | 3 |
| ExitMethods.cs:53:17:53:26 | enter ErrorMaybe | ExitMethods.cs:55:13:55:13 | access to parameter b | 4 |
| ExitMethods.cs:53:17:53:26 | exit ErrorMaybe | ExitMethods.cs:53:17:53:26 | exit ErrorMaybe | 1 |
| ExitMethods.cs:56:19:56:33 | object creation of type Exception | ExitMethods.cs:56:13:56:34 | throw ...; | 2 |
| ExitMethods.cs:59:17:59:27 | enter ErrorAlways | ExitMethods.cs:61:13:61:13 | access to parameter b | 4 |
| ExitMethods.cs:59:17:59:27 | exit ErrorAlways | ExitMethods.cs:59:17:59:27 | exit ErrorAlways | 1 |
| ExitMethods.cs:62:19:62:33 | object creation of type Exception | ExitMethods.cs:62:13:62:34 | throw ...; | 2 |
| ExitMethods.cs:64:41:64:43 | "b" | ExitMethods.cs:64:13:64:45 | throw ...; | 3 |
| ExitMethods.cs:67:10:67:13 | enter Exit | ExitMethods.cs:67:10:67:13 | exit Exit | 6 |
| ExitMethods.cs:72:10:72:18 | enter ExitInTry | ExitMethods.cs:72:10:72:18 | exit ExitInTry | 8 |
| ExitMethods.cs:85:10:85:24 | enter ApplicationExit | ExitMethods.cs:85:10:85:24 | exit ApplicationExit | 5 |
| ExitMethods.cs:90:13:90:21 | enter ThrowExpr | ExitMethods.cs:92:16:92:25 | ... != ... | 7 |
| ExitMethods.cs:90:13:90:21 | exit ThrowExpr | ExitMethods.cs:90:13:90:21 | exit ThrowExpr | 1 |
| ExitMethods.cs:92:29:92:29 | 1 | ExitMethods.cs:92:9:92:77 | return ...; | 5 |
| ExitMethods.cs:92:69:92:75 | "input" | ExitMethods.cs:92:41:92:76 | throw ... | 3 |
| ExitMethods.cs:95:16:95:34 | enter ExtensionMethodCall | ExitMethods.cs:97:16:97:30 | call to method Contains | 6 |
| ExitMethods.cs:97:9:97:39 | return ...; | ExitMethods.cs:95:16:95:34 | exit ExtensionMethodCall | 2 |
| ExitMethods.cs:97:34:97:34 | 0 | ExitMethods.cs:97:34:97:34 | 0 | 1 |
| ExitMethods.cs:97:38:97:38 | 1 | ExitMethods.cs:97:38:97:38 | 1 | 1 |
| ExitMethods.cs:100:17:100:32 | enter FailingAssertion | ExitMethods.cs:100:17:100:32 | exit FailingAssertion | 6 |
| ExitMethods.cs:106:17:106:33 | enter FailingAssertion2 | ExitMethods.cs:106:17:106:33 | exit FailingAssertion2 | 6 |
| ExitMethods.cs:112:10:112:20 | enter AssertFalse | ExitMethods.cs:112:10:112:20 | exit AssertFalse | 4 |
| ExitMethods.cs:114:17:114:33 | enter FailingAssertion3 | ExitMethods.cs:114:17:114:33 | exit FailingAssertion3 | 7 |
| Extensions.cs:5:23:5:29 | enter ToInt32 | Extensions.cs:5:23:5:29 | exit ToInt32 | 6 |
| Extensions.cs:10:24:10:29 | enter ToBool | Extensions.cs:10:24:10:29 | exit ToBool | 7 |
| Extensions.cs:15:23:15:33 | enter CallToInt32 | Extensions.cs:15:23:15:33 | exit CallToInt32 | 4 |

View File

@@ -1,7 +1,7 @@
import csharp
import semmle.code.csharp.controlflow.BasicBlocks
import Common
from BasicBlock bb
from SourceBasicBlock bb
select
bb.getFirstNode(),
bb.getLastNode(),

View File

@@ -360,52 +360,56 @@
| post | Conditions.cs:110:16:110:16 | access to local variable x | Conditions.cs:108:13:109:24 | [b (line 102): false] if (...) ... |
| post | Conditions.cs:110:16:110:16 | access to local variable x | Conditions.cs:108:13:109:24 | [b (line 102): true] if (...) ... |
| post | Conditions.cs:110:16:110:16 | access to local variable x | Conditions.cs:110:16:110:16 | access to local variable x |
| post | ExitMethods.cs:6:10:6:11 | enter M1 | ExitMethods.cs:6:10:6:11 | enter M1 |
| post | ExitMethods.cs:12:10:12:11 | enter M2 | ExitMethods.cs:12:10:12:11 | enter M2 |
| post | ExitMethods.cs:18:10:18:11 | enter M3 | ExitMethods.cs:18:10:18:11 | enter M3 |
| post | ExitMethods.cs:24:10:24:11 | enter M4 | ExitMethods.cs:24:10:24:11 | enter M4 |
| post | ExitMethods.cs:30:10:30:11 | enter M5 | ExitMethods.cs:30:10:30:11 | enter M5 |
| post | ExitMethods.cs:36:10:36:11 | enter M6 | ExitMethods.cs:36:10:36:11 | enter M6 |
| post | ExitMethods.cs:36:10:36:11 | exit M6 | ExitMethods.cs:36:10:36:11 | enter M6 |
| post | ExitMethods.cs:36:10:36:11 | exit M6 | ExitMethods.cs:36:10:36:11 | exit M6 |
| post | ExitMethods.cs:36:10:36:11 | exit M6 | ExitMethods.cs:42:9:45:9 | [exception: ArgumentException] catch (...) {...} |
| post | ExitMethods.cs:36:10:36:11 | exit M6 | ExitMethods.cs:42:9:45:9 | [exception: Exception] catch (...) {...} |
| post | ExitMethods.cs:36:10:36:11 | exit M6 | ExitMethods.cs:43:9:45:9 | {...} |
| post | ExitMethods.cs:36:10:36:11 | exit M6 | ExitMethods.cs:46:9:49:9 | [exception: Exception] catch (...) {...} |
| post | ExitMethods.cs:42:9:45:9 | [exception: ArgumentException] catch (...) {...} | ExitMethods.cs:42:9:45:9 | [exception: ArgumentException] catch (...) {...} |
| post | ExitMethods.cs:42:9:45:9 | [exception: Exception] catch (...) {...} | ExitMethods.cs:42:9:45:9 | [exception: Exception] catch (...) {...} |
| post | ExitMethods.cs:43:9:45:9 | {...} | ExitMethods.cs:42:9:45:9 | [exception: ArgumentException] catch (...) {...} |
| post | ExitMethods.cs:43:9:45:9 | {...} | ExitMethods.cs:43:9:45:9 | {...} |
| post | ExitMethods.cs:46:9:49:9 | [exception: Exception] catch (...) {...} | ExitMethods.cs:46:9:49:9 | [exception: Exception] catch (...) {...} |
| post | ExitMethods.cs:52:17:52:26 | enter ErrorMaybe | ExitMethods.cs:52:17:52:26 | enter ErrorMaybe |
| post | ExitMethods.cs:52:17:52:26 | exit ErrorMaybe | ExitMethods.cs:52:17:52:26 | enter ErrorMaybe |
| post | ExitMethods.cs:52:17:52:26 | exit ErrorMaybe | ExitMethods.cs:52:17:52:26 | exit ErrorMaybe |
| post | ExitMethods.cs:52:17:52:26 | exit ErrorMaybe | ExitMethods.cs:55:19:55:33 | object creation of type Exception |
| post | ExitMethods.cs:55:19:55:33 | object creation of type Exception | ExitMethods.cs:55:19:55:33 | object creation of type Exception |
| post | ExitMethods.cs:58:17:58:27 | enter ErrorAlways | ExitMethods.cs:58:17:58:27 | enter ErrorAlways |
| post | ExitMethods.cs:58:17:58:27 | exit ErrorAlways | ExitMethods.cs:58:17:58:27 | enter ErrorAlways |
| post | ExitMethods.cs:58:17:58:27 | exit ErrorAlways | ExitMethods.cs:58:17:58:27 | exit ErrorAlways |
| post | ExitMethods.cs:58:17:58:27 | exit ErrorAlways | ExitMethods.cs:61:19:61:33 | object creation of type Exception |
| post | ExitMethods.cs:58:17:58:27 | exit ErrorAlways | ExitMethods.cs:63:41:63:43 | "b" |
| post | ExitMethods.cs:61:19:61:33 | object creation of type Exception | ExitMethods.cs:61:19:61:33 | object creation of type Exception |
| post | ExitMethods.cs:63:41:63:43 | "b" | ExitMethods.cs:63:41:63:43 | "b" |
| post | ExitMethods.cs:66:10:66:13 | enter Exit | ExitMethods.cs:66:10:66:13 | enter Exit |
| post | ExitMethods.cs:71:10:71:24 | enter ApplicationExit | ExitMethods.cs:71:10:71:24 | enter ApplicationExit |
| post | ExitMethods.cs:76:13:76:21 | enter ThrowExpr | ExitMethods.cs:76:13:76:21 | enter ThrowExpr |
| post | ExitMethods.cs:76:13:76:21 | exit ThrowExpr | ExitMethods.cs:76:13:76:21 | enter ThrowExpr |
| post | ExitMethods.cs:76:13:76:21 | exit ThrowExpr | ExitMethods.cs:76:13:76:21 | exit ThrowExpr |
| post | ExitMethods.cs:76:13:76:21 | exit ThrowExpr | ExitMethods.cs:78:29:78:29 | 1 |
| post | ExitMethods.cs:76:13:76:21 | exit ThrowExpr | ExitMethods.cs:78:69:78:75 | "input" |
| post | ExitMethods.cs:78:29:78:29 | 1 | ExitMethods.cs:78:29:78:29 | 1 |
| post | ExitMethods.cs:78:69:78:75 | "input" | ExitMethods.cs:78:69:78:75 | "input" |
| post | ExitMethods.cs:81:16:81:34 | enter ExtensionMethodCall | ExitMethods.cs:81:16:81:34 | enter ExtensionMethodCall |
| post | ExitMethods.cs:83:9:83:39 | return ...; | ExitMethods.cs:81:16:81:34 | enter ExtensionMethodCall |
| post | ExitMethods.cs:83:9:83:39 | return ...; | ExitMethods.cs:83:9:83:39 | return ...; |
| post | ExitMethods.cs:83:9:83:39 | return ...; | ExitMethods.cs:83:34:83:34 | 0 |
| post | ExitMethods.cs:83:9:83:39 | return ...; | ExitMethods.cs:83:38:83:38 | 1 |
| post | ExitMethods.cs:83:34:83:34 | 0 | ExitMethods.cs:83:34:83:34 | 0 |
| post | ExitMethods.cs:83:38:83:38 | 1 | ExitMethods.cs:83:38:83:38 | 1 |
| post | ExitMethods.cs:91:28:91:31 | enter Exit | ExitMethods.cs:91:28:91:31 | enter Exit |
| post | ExitMethods.cs:7:10:7:11 | enter M1 | ExitMethods.cs:7:10:7:11 | enter M1 |
| post | ExitMethods.cs:13:10:13:11 | enter M2 | ExitMethods.cs:13:10:13:11 | enter M2 |
| post | ExitMethods.cs:19:10:19:11 | enter M3 | ExitMethods.cs:19:10:19:11 | enter M3 |
| post | ExitMethods.cs:25:10:25:11 | enter M4 | ExitMethods.cs:25:10:25:11 | enter M4 |
| post | ExitMethods.cs:31:10:31:11 | enter M5 | ExitMethods.cs:31:10:31:11 | enter M5 |
| post | ExitMethods.cs:37:10:37:11 | enter M6 | ExitMethods.cs:37:10:37:11 | enter M6 |
| post | ExitMethods.cs:37:10:37:11 | exit M6 | ExitMethods.cs:37:10:37:11 | enter M6 |
| post | ExitMethods.cs:37:10:37:11 | exit M6 | ExitMethods.cs:37:10:37:11 | exit M6 |
| post | ExitMethods.cs:37:10:37:11 | exit M6 | ExitMethods.cs:43:9:46:9 | [exception: ArgumentException] catch (...) {...} |
| post | ExitMethods.cs:37:10:37:11 | exit M6 | ExitMethods.cs:43:9:46:9 | [exception: Exception] catch (...) {...} |
| post | ExitMethods.cs:37:10:37:11 | exit M6 | ExitMethods.cs:44:9:46:9 | {...} |
| post | ExitMethods.cs:37:10:37:11 | exit M6 | ExitMethods.cs:47:9:50:9 | [exception: Exception] catch (...) {...} |
| post | ExitMethods.cs:43:9:46:9 | [exception: ArgumentException] catch (...) {...} | ExitMethods.cs:43:9:46:9 | [exception: ArgumentException] catch (...) {...} |
| post | ExitMethods.cs:43:9:46:9 | [exception: Exception] catch (...) {...} | ExitMethods.cs:43:9:46:9 | [exception: Exception] catch (...) {...} |
| post | ExitMethods.cs:44:9:46:9 | {...} | ExitMethods.cs:43:9:46:9 | [exception: ArgumentException] catch (...) {...} |
| post | ExitMethods.cs:44:9:46:9 | {...} | ExitMethods.cs:44:9:46:9 | {...} |
| post | ExitMethods.cs:47:9:50:9 | [exception: Exception] catch (...) {...} | ExitMethods.cs:47:9:50:9 | [exception: Exception] catch (...) {...} |
| post | ExitMethods.cs:53:17:53:26 | enter ErrorMaybe | ExitMethods.cs:53:17:53:26 | enter ErrorMaybe |
| post | ExitMethods.cs:53:17:53:26 | exit ErrorMaybe | ExitMethods.cs:53:17:53:26 | enter ErrorMaybe |
| post | ExitMethods.cs:53:17:53:26 | exit ErrorMaybe | ExitMethods.cs:53:17:53:26 | exit ErrorMaybe |
| post | ExitMethods.cs:53:17:53:26 | exit ErrorMaybe | ExitMethods.cs:56:19:56:33 | object creation of type Exception |
| post | ExitMethods.cs:56:19:56:33 | object creation of type Exception | ExitMethods.cs:56:19:56:33 | object creation of type Exception |
| post | ExitMethods.cs:59:17:59:27 | enter ErrorAlways | ExitMethods.cs:59:17:59:27 | enter ErrorAlways |
| post | ExitMethods.cs:59:17:59:27 | exit ErrorAlways | ExitMethods.cs:59:17:59:27 | enter ErrorAlways |
| post | ExitMethods.cs:59:17:59:27 | exit ErrorAlways | ExitMethods.cs:59:17:59:27 | exit ErrorAlways |
| post | ExitMethods.cs:59:17:59:27 | exit ErrorAlways | ExitMethods.cs:62:19:62:33 | object creation of type Exception |
| post | ExitMethods.cs:59:17:59:27 | exit ErrorAlways | ExitMethods.cs:64:41:64:43 | "b" |
| post | ExitMethods.cs:62:19:62:33 | object creation of type Exception | ExitMethods.cs:62:19:62:33 | object creation of type Exception |
| post | ExitMethods.cs:64:41:64:43 | "b" | ExitMethods.cs:64:41:64:43 | "b" |
| post | ExitMethods.cs:67:10:67:13 | enter Exit | ExitMethods.cs:67:10:67:13 | enter Exit |
| post | ExitMethods.cs:72:10:72:18 | enter ExitInTry | ExitMethods.cs:72:10:72:18 | enter ExitInTry |
| post | ExitMethods.cs:85:10:85:24 | enter ApplicationExit | ExitMethods.cs:85:10:85:24 | enter ApplicationExit |
| post | ExitMethods.cs:90:13:90:21 | enter ThrowExpr | ExitMethods.cs:90:13:90:21 | enter ThrowExpr |
| post | ExitMethods.cs:90:13:90:21 | exit ThrowExpr | ExitMethods.cs:90:13:90:21 | enter ThrowExpr |
| post | ExitMethods.cs:90:13:90:21 | exit ThrowExpr | ExitMethods.cs:90:13:90:21 | exit ThrowExpr |
| post | ExitMethods.cs:90:13:90:21 | exit ThrowExpr | ExitMethods.cs:92:29:92:29 | 1 |
| post | ExitMethods.cs:90:13:90:21 | exit ThrowExpr | ExitMethods.cs:92:69:92:75 | "input" |
| post | ExitMethods.cs:92:29:92:29 | 1 | ExitMethods.cs:92:29:92:29 | 1 |
| post | ExitMethods.cs:92:69:92:75 | "input" | ExitMethods.cs:92:69:92:75 | "input" |
| post | ExitMethods.cs:95:16:95:34 | enter ExtensionMethodCall | ExitMethods.cs:95:16:95:34 | enter ExtensionMethodCall |
| post | ExitMethods.cs:97:9:97:39 | return ...; | ExitMethods.cs:95:16:95:34 | enter ExtensionMethodCall |
| post | ExitMethods.cs:97:9:97:39 | return ...; | ExitMethods.cs:97:9:97:39 | return ...; |
| post | ExitMethods.cs:97:9:97:39 | return ...; | ExitMethods.cs:97:34:97:34 | 0 |
| post | ExitMethods.cs:97:9:97:39 | return ...; | ExitMethods.cs:97:38:97:38 | 1 |
| post | ExitMethods.cs:97:34:97:34 | 0 | ExitMethods.cs:97:34:97:34 | 0 |
| post | ExitMethods.cs:97:38:97:38 | 1 | ExitMethods.cs:97:38:97:38 | 1 |
| post | ExitMethods.cs:100:17:100:32 | enter FailingAssertion | ExitMethods.cs:100:17:100:32 | enter FailingAssertion |
| post | ExitMethods.cs:106:17:106:33 | enter FailingAssertion2 | ExitMethods.cs:106:17:106:33 | enter FailingAssertion2 |
| post | ExitMethods.cs:112:10:112:20 | enter AssertFalse | ExitMethods.cs:112:10:112:20 | enter AssertFalse |
| post | ExitMethods.cs:114:17:114:33 | enter FailingAssertion3 | ExitMethods.cs:114:17:114:33 | enter FailingAssertion3 |
| post | Extensions.cs:5:23:5:29 | enter ToInt32 | Extensions.cs:5:23:5:29 | enter ToInt32 |
| post | Extensions.cs:10:24:10:29 | enter ToBool | Extensions.cs:10:24:10:29 | enter ToBool |
| post | Extensions.cs:15:23:15:33 | enter CallToInt32 | Extensions.cs:15:23:15:33 | enter CallToInt32 |
@@ -1701,52 +1705,56 @@
| pre | Conditions.cs:108:13:109:24 | [b (line 102): false] if (...) ... | Conditions.cs:108:13:109:24 | [b (line 102): false] if (...) ... |
| pre | Conditions.cs:108:13:109:24 | [b (line 102): true] if (...) ... | Conditions.cs:108:13:109:24 | [b (line 102): true] if (...) ... |
| pre | Conditions.cs:110:16:110:16 | access to local variable x | Conditions.cs:110:16:110:16 | access to local variable x |
| pre | ExitMethods.cs:6:10:6:11 | enter M1 | ExitMethods.cs:6:10:6:11 | enter M1 |
| pre | ExitMethods.cs:12:10:12:11 | enter M2 | ExitMethods.cs:12:10:12:11 | enter M2 |
| pre | ExitMethods.cs:18:10:18:11 | enter M3 | ExitMethods.cs:18:10:18:11 | enter M3 |
| pre | ExitMethods.cs:24:10:24:11 | enter M4 | ExitMethods.cs:24:10:24:11 | enter M4 |
| pre | ExitMethods.cs:30:10:30:11 | enter M5 | ExitMethods.cs:30:10:30:11 | enter M5 |
| pre | ExitMethods.cs:36:10:36:11 | enter M6 | ExitMethods.cs:36:10:36:11 | enter M6 |
| pre | ExitMethods.cs:36:10:36:11 | enter M6 | ExitMethods.cs:36:10:36:11 | exit M6 |
| pre | ExitMethods.cs:36:10:36:11 | enter M6 | ExitMethods.cs:42:9:45:9 | [exception: ArgumentException] catch (...) {...} |
| pre | ExitMethods.cs:36:10:36:11 | enter M6 | ExitMethods.cs:42:9:45:9 | [exception: Exception] catch (...) {...} |
| pre | ExitMethods.cs:36:10:36:11 | enter M6 | ExitMethods.cs:43:9:45:9 | {...} |
| pre | ExitMethods.cs:36:10:36:11 | enter M6 | ExitMethods.cs:46:9:49:9 | [exception: Exception] catch (...) {...} |
| pre | ExitMethods.cs:36:10:36:11 | exit M6 | ExitMethods.cs:36:10:36:11 | exit M6 |
| pre | ExitMethods.cs:42:9:45:9 | [exception: ArgumentException] catch (...) {...} | ExitMethods.cs:42:9:45:9 | [exception: ArgumentException] catch (...) {...} |
| pre | ExitMethods.cs:42:9:45:9 | [exception: Exception] catch (...) {...} | ExitMethods.cs:42:9:45:9 | [exception: Exception] catch (...) {...} |
| pre | ExitMethods.cs:42:9:45:9 | [exception: Exception] catch (...) {...} | ExitMethods.cs:46:9:49:9 | [exception: Exception] catch (...) {...} |
| pre | ExitMethods.cs:43:9:45:9 | {...} | ExitMethods.cs:43:9:45:9 | {...} |
| pre | ExitMethods.cs:46:9:49:9 | [exception: Exception] catch (...) {...} | ExitMethods.cs:46:9:49:9 | [exception: Exception] catch (...) {...} |
| pre | ExitMethods.cs:52:17:52:26 | enter ErrorMaybe | ExitMethods.cs:52:17:52:26 | enter ErrorMaybe |
| pre | ExitMethods.cs:52:17:52:26 | enter ErrorMaybe | ExitMethods.cs:52:17:52:26 | exit ErrorMaybe |
| pre | ExitMethods.cs:52:17:52:26 | enter ErrorMaybe | ExitMethods.cs:55:19:55:33 | object creation of type Exception |
| pre | ExitMethods.cs:52:17:52:26 | exit ErrorMaybe | ExitMethods.cs:52:17:52:26 | exit ErrorMaybe |
| pre | ExitMethods.cs:55:19:55:33 | object creation of type Exception | ExitMethods.cs:55:19:55:33 | object creation of type Exception |
| pre | ExitMethods.cs:58:17:58:27 | enter ErrorAlways | ExitMethods.cs:58:17:58:27 | enter ErrorAlways |
| pre | ExitMethods.cs:58:17:58:27 | enter ErrorAlways | ExitMethods.cs:58:17:58:27 | exit ErrorAlways |
| pre | ExitMethods.cs:58:17:58:27 | enter ErrorAlways | ExitMethods.cs:61:19:61:33 | object creation of type Exception |
| pre | ExitMethods.cs:58:17:58:27 | enter ErrorAlways | ExitMethods.cs:63:41:63:43 | "b" |
| pre | ExitMethods.cs:58:17:58:27 | exit ErrorAlways | ExitMethods.cs:58:17:58:27 | exit ErrorAlways |
| pre | ExitMethods.cs:61:19:61:33 | object creation of type Exception | ExitMethods.cs:61:19:61:33 | object creation of type Exception |
| pre | ExitMethods.cs:63:41:63:43 | "b" | ExitMethods.cs:63:41:63:43 | "b" |
| pre | ExitMethods.cs:66:10:66:13 | enter Exit | ExitMethods.cs:66:10:66:13 | enter Exit |
| pre | ExitMethods.cs:71:10:71:24 | enter ApplicationExit | ExitMethods.cs:71:10:71:24 | enter ApplicationExit |
| pre | ExitMethods.cs:76:13:76:21 | enter ThrowExpr | ExitMethods.cs:76:13:76:21 | enter ThrowExpr |
| pre | ExitMethods.cs:76:13:76:21 | enter ThrowExpr | ExitMethods.cs:76:13:76:21 | exit ThrowExpr |
| pre | ExitMethods.cs:76:13:76:21 | enter ThrowExpr | ExitMethods.cs:78:29:78:29 | 1 |
| pre | ExitMethods.cs:76:13:76:21 | enter ThrowExpr | ExitMethods.cs:78:69:78:75 | "input" |
| pre | ExitMethods.cs:76:13:76:21 | exit ThrowExpr | ExitMethods.cs:76:13:76:21 | exit ThrowExpr |
| pre | ExitMethods.cs:78:29:78:29 | 1 | ExitMethods.cs:78:29:78:29 | 1 |
| pre | ExitMethods.cs:78:69:78:75 | "input" | ExitMethods.cs:78:69:78:75 | "input" |
| pre | ExitMethods.cs:81:16:81:34 | enter ExtensionMethodCall | ExitMethods.cs:81:16:81:34 | enter ExtensionMethodCall |
| pre | ExitMethods.cs:81:16:81:34 | enter ExtensionMethodCall | ExitMethods.cs:83:9:83:39 | return ...; |
| pre | ExitMethods.cs:81:16:81:34 | enter ExtensionMethodCall | ExitMethods.cs:83:34:83:34 | 0 |
| pre | ExitMethods.cs:81:16:81:34 | enter ExtensionMethodCall | ExitMethods.cs:83:38:83:38 | 1 |
| pre | ExitMethods.cs:83:9:83:39 | return ...; | ExitMethods.cs:83:9:83:39 | return ...; |
| pre | ExitMethods.cs:83:34:83:34 | 0 | ExitMethods.cs:83:34:83:34 | 0 |
| pre | ExitMethods.cs:83:38:83:38 | 1 | ExitMethods.cs:83:38:83:38 | 1 |
| pre | ExitMethods.cs:91:28:91:31 | enter Exit | ExitMethods.cs:91:28:91:31 | enter Exit |
| pre | ExitMethods.cs:7:10:7:11 | enter M1 | ExitMethods.cs:7:10:7:11 | enter M1 |
| pre | ExitMethods.cs:13:10:13:11 | enter M2 | ExitMethods.cs:13:10:13:11 | enter M2 |
| pre | ExitMethods.cs:19:10:19:11 | enter M3 | ExitMethods.cs:19:10:19:11 | enter M3 |
| pre | ExitMethods.cs:25:10:25:11 | enter M4 | ExitMethods.cs:25:10:25:11 | enter M4 |
| pre | ExitMethods.cs:31:10:31:11 | enter M5 | ExitMethods.cs:31:10:31:11 | enter M5 |
| pre | ExitMethods.cs:37:10:37:11 | enter M6 | ExitMethods.cs:37:10:37:11 | enter M6 |
| pre | ExitMethods.cs:37:10:37:11 | enter M6 | ExitMethods.cs:37:10:37:11 | exit M6 |
| pre | ExitMethods.cs:37:10:37:11 | enter M6 | ExitMethods.cs:43:9:46:9 | [exception: ArgumentException] catch (...) {...} |
| pre | ExitMethods.cs:37:10:37:11 | enter M6 | ExitMethods.cs:43:9:46:9 | [exception: Exception] catch (...) {...} |
| pre | ExitMethods.cs:37:10:37:11 | enter M6 | ExitMethods.cs:44:9:46:9 | {...} |
| pre | ExitMethods.cs:37:10:37:11 | enter M6 | ExitMethods.cs:47:9:50:9 | [exception: Exception] catch (...) {...} |
| pre | ExitMethods.cs:37:10:37:11 | exit M6 | ExitMethods.cs:37:10:37:11 | exit M6 |
| pre | ExitMethods.cs:43:9:46:9 | [exception: ArgumentException] catch (...) {...} | ExitMethods.cs:43:9:46:9 | [exception: ArgumentException] catch (...) {...} |
| pre | ExitMethods.cs:43:9:46:9 | [exception: Exception] catch (...) {...} | ExitMethods.cs:43:9:46:9 | [exception: Exception] catch (...) {...} |
| pre | ExitMethods.cs:43:9:46:9 | [exception: Exception] catch (...) {...} | ExitMethods.cs:47:9:50:9 | [exception: Exception] catch (...) {...} |
| pre | ExitMethods.cs:44:9:46:9 | {...} | ExitMethods.cs:44:9:46:9 | {...} |
| pre | ExitMethods.cs:47:9:50:9 | [exception: Exception] catch (...) {...} | ExitMethods.cs:47:9:50:9 | [exception: Exception] catch (...) {...} |
| pre | ExitMethods.cs:53:17:53:26 | enter ErrorMaybe | ExitMethods.cs:53:17:53:26 | enter ErrorMaybe |
| pre | ExitMethods.cs:53:17:53:26 | enter ErrorMaybe | ExitMethods.cs:53:17:53:26 | exit ErrorMaybe |
| pre | ExitMethods.cs:53:17:53:26 | enter ErrorMaybe | ExitMethods.cs:56:19:56:33 | object creation of type Exception |
| pre | ExitMethods.cs:53:17:53:26 | exit ErrorMaybe | ExitMethods.cs:53:17:53:26 | exit ErrorMaybe |
| pre | ExitMethods.cs:56:19:56:33 | object creation of type Exception | ExitMethods.cs:56:19:56:33 | object creation of type Exception |
| pre | ExitMethods.cs:59:17:59:27 | enter ErrorAlways | ExitMethods.cs:59:17:59:27 | enter ErrorAlways |
| pre | ExitMethods.cs:59:17:59:27 | enter ErrorAlways | ExitMethods.cs:59:17:59:27 | exit ErrorAlways |
| pre | ExitMethods.cs:59:17:59:27 | enter ErrorAlways | ExitMethods.cs:62:19:62:33 | object creation of type Exception |
| pre | ExitMethods.cs:59:17:59:27 | enter ErrorAlways | ExitMethods.cs:64:41:64:43 | "b" |
| pre | ExitMethods.cs:59:17:59:27 | exit ErrorAlways | ExitMethods.cs:59:17:59:27 | exit ErrorAlways |
| pre | ExitMethods.cs:62:19:62:33 | object creation of type Exception | ExitMethods.cs:62:19:62:33 | object creation of type Exception |
| pre | ExitMethods.cs:64:41:64:43 | "b" | ExitMethods.cs:64:41:64:43 | "b" |
| pre | ExitMethods.cs:67:10:67:13 | enter Exit | ExitMethods.cs:67:10:67:13 | enter Exit |
| pre | ExitMethods.cs:72:10:72:18 | enter ExitInTry | ExitMethods.cs:72:10:72:18 | enter ExitInTry |
| pre | ExitMethods.cs:85:10:85:24 | enter ApplicationExit | ExitMethods.cs:85:10:85:24 | enter ApplicationExit |
| pre | ExitMethods.cs:90:13:90:21 | enter ThrowExpr | ExitMethods.cs:90:13:90:21 | enter ThrowExpr |
| pre | ExitMethods.cs:90:13:90:21 | enter ThrowExpr | ExitMethods.cs:90:13:90:21 | exit ThrowExpr |
| pre | ExitMethods.cs:90:13:90:21 | enter ThrowExpr | ExitMethods.cs:92:29:92:29 | 1 |
| pre | ExitMethods.cs:90:13:90:21 | enter ThrowExpr | ExitMethods.cs:92:69:92:75 | "input" |
| pre | ExitMethods.cs:90:13:90:21 | exit ThrowExpr | ExitMethods.cs:90:13:90:21 | exit ThrowExpr |
| pre | ExitMethods.cs:92:29:92:29 | 1 | ExitMethods.cs:92:29:92:29 | 1 |
| pre | ExitMethods.cs:92:69:92:75 | "input" | ExitMethods.cs:92:69:92:75 | "input" |
| pre | ExitMethods.cs:95:16:95:34 | enter ExtensionMethodCall | ExitMethods.cs:95:16:95:34 | enter ExtensionMethodCall |
| pre | ExitMethods.cs:95:16:95:34 | enter ExtensionMethodCall | ExitMethods.cs:97:9:97:39 | return ...; |
| pre | ExitMethods.cs:95:16:95:34 | enter ExtensionMethodCall | ExitMethods.cs:97:34:97:34 | 0 |
| pre | ExitMethods.cs:95:16:95:34 | enter ExtensionMethodCall | ExitMethods.cs:97:38:97:38 | 1 |
| pre | ExitMethods.cs:97:9:97:39 | return ...; | ExitMethods.cs:97:9:97:39 | return ...; |
| pre | ExitMethods.cs:97:34:97:34 | 0 | ExitMethods.cs:97:34:97:34 | 0 |
| pre | ExitMethods.cs:97:38:97:38 | 1 | ExitMethods.cs:97:38:97:38 | 1 |
| pre | ExitMethods.cs:100:17:100:32 | enter FailingAssertion | ExitMethods.cs:100:17:100:32 | enter FailingAssertion |
| pre | ExitMethods.cs:106:17:106:33 | enter FailingAssertion2 | ExitMethods.cs:106:17:106:33 | enter FailingAssertion2 |
| pre | ExitMethods.cs:112:10:112:20 | enter AssertFalse | ExitMethods.cs:112:10:112:20 | enter AssertFalse |
| pre | ExitMethods.cs:114:17:114:33 | enter FailingAssertion3 | ExitMethods.cs:114:17:114:33 | enter FailingAssertion3 |
| pre | Extensions.cs:5:23:5:29 | enter ToInt32 | Extensions.cs:5:23:5:29 | enter ToInt32 |
| pre | Extensions.cs:10:24:10:29 | enter ToBool | Extensions.cs:10:24:10:29 | enter ToBool |
| pre | Extensions.cs:15:23:15:33 | enter CallToInt32 | Extensions.cs:15:23:15:33 | enter CallToInt32 |

View File

@@ -1,7 +1,7 @@
import csharp
import semmle.code.csharp.controlflow.BasicBlocks
import Common
from BasicBlock dom, BasicBlock bb, string s
from SourceBasicBlock dom, SourceBasicBlock bb, string s
where
dom.dominates(bb) and s = "pre"
or

View File

@@ -0,0 +1,25 @@
import csharp
class StubFile extends File {
StubFile() {
this.getAbsolutePath().matches("%resources/stubs/%")
}
}
class SourceControlFlowElement extends ControlFlowElement {
SourceControlFlowElement() {
not this.getLocation().getFile() instanceof StubFile
}
}
class SourceControlFlowNode extends ControlFlow::Node {
SourceControlFlowNode() {
not this.getLocation().getFile() instanceof StubFile
}
}
class SourceBasicBlock extends ControlFlow::BasicBlock {
SourceBasicBlock() {
not this.getLocation().getFile() instanceof StubFile
}
}

View File

@@ -155,14 +155,14 @@
| Conditions.cs:105:13:105:13 | access to parameter b | Conditions.cs:108:13:109:24 | [b (line 102): true] if (...) ... | true |
| Conditions.cs:107:13:107:24 | [b (line 102): false] ... > ... | Conditions.cs:108:13:109:24 | [b (line 102): false] if (...) ... | true |
| Conditions.cs:107:13:107:24 | [b (line 102): true] ... > ... | Conditions.cs:108:13:109:24 | [b (line 102): true] if (...) ... | true |
| ExitMethods.cs:42:9:45:9 | [exception: Exception] catch (...) {...} | ExitMethods.cs:46:9:49:9 | [exception: Exception] catch (...) {...} | false |
| ExitMethods.cs:54:13:54:13 | access to parameter b | ExitMethods.cs:55:19:55:33 | object creation of type Exception | true |
| ExitMethods.cs:60:13:60:13 | access to parameter b | ExitMethods.cs:61:19:61:33 | object creation of type Exception | true |
| ExitMethods.cs:60:13:60:13 | access to parameter b | ExitMethods.cs:63:41:63:43 | "b" | false |
| ExitMethods.cs:78:16:78:25 | ... != ... | ExitMethods.cs:78:29:78:29 | 1 | true |
| ExitMethods.cs:78:16:78:25 | ... != ... | ExitMethods.cs:78:69:78:75 | "input" | false |
| ExitMethods.cs:83:16:83:30 | call to method Contains | ExitMethods.cs:83:34:83:34 | 0 | true |
| ExitMethods.cs:83:16:83:30 | call to method Contains | ExitMethods.cs:83:38:83:38 | 1 | false |
| ExitMethods.cs:43:9:46:9 | [exception: Exception] catch (...) {...} | ExitMethods.cs:47:9:50:9 | [exception: Exception] catch (...) {...} | false |
| ExitMethods.cs:55:13:55:13 | access to parameter b | ExitMethods.cs:56:19:56:33 | object creation of type Exception | true |
| ExitMethods.cs:61:13:61:13 | access to parameter b | ExitMethods.cs:62:19:62:33 | object creation of type Exception | true |
| ExitMethods.cs:61:13:61:13 | access to parameter b | ExitMethods.cs:64:41:64:43 | "b" | false |
| ExitMethods.cs:92:16:92:25 | ... != ... | ExitMethods.cs:92:29:92:29 | 1 | true |
| ExitMethods.cs:92:16:92:25 | ... != ... | ExitMethods.cs:92:69:92:75 | "input" | false |
| ExitMethods.cs:97:16:97:30 | call to method Contains | ExitMethods.cs:97:34:97:34 | 0 | true |
| ExitMethods.cs:97:16:97:30 | call to method Contains | ExitMethods.cs:97:38:97:38 | 1 | false |
| Foreach.cs:8:9:9:13 | foreach (... ... in ...) ... | Foreach.cs:6:10:6:11 | exit M1 | true |
| Foreach.cs:8:9:9:13 | foreach (... ... in ...) ... | Foreach.cs:8:22:8:24 | String arg | false |
| Foreach.cs:14:9:15:13 | foreach (... ... in ...) ... | Foreach.cs:12:10:12:11 | exit M2 | true |

View File

@@ -116,10 +116,8 @@
| 51 | 17 | Conditions.cs:51:17:51:17 | [b (line 46): true] access to parameter b | true | 52 | 17 | Conditions.cs:52:17:52:20 | [b (line 46): true] ...; |
| 51 | 17 | Conditions.cs:51:17:51:17 | access to parameter b | false | 49 | 16 | Conditions.cs:49:16:49:16 | [b (line 46): false] access to parameter x |
| 51 | 17 | Conditions.cs:51:17:51:17 | access to parameter b | true | 52 | 17 | Conditions.cs:52:17:52:20 | [b (line 46): true] ...; |
| 54 | 13 | ExitMethods.cs:54:13:54:13 | access to parameter b | false | 52 | 17 | ExitMethods.cs:52:17:52:26 | exit ErrorMaybe |
| 54 | 13 | ExitMethods.cs:54:13:54:13 | access to parameter b | true | 55 | 19 | ExitMethods.cs:55:19:55:33 | object creation of type Exception |
| 60 | 13 | ExitMethods.cs:60:13:60:13 | access to parameter b | false | 63 | 41 | ExitMethods.cs:63:41:63:43 | "b" |
| 60 | 13 | ExitMethods.cs:60:13:60:13 | access to parameter b | true | 61 | 19 | ExitMethods.cs:61:19:61:33 | object creation of type Exception |
| 55 | 13 | ExitMethods.cs:55:13:55:13 | access to parameter b | false | 53 | 17 | ExitMethods.cs:53:17:53:26 | exit ErrorMaybe |
| 55 | 13 | ExitMethods.cs:55:13:55:13 | access to parameter b | true | 56 | 19 | ExitMethods.cs:56:19:56:33 | object creation of type Exception |
| 60 | 16 | Conditions.cs:60:16:60:22 | ... > ... | false | 65 | 9 | Conditions.cs:65:9:66:16 | if (...) ... |
| 60 | 16 | Conditions.cs:60:16:60:22 | ... > ... | true | 61 | 9 | Conditions.cs:61:9:64:9 | {...} |
| 60 | 16 | Conditions.cs:60:16:60:22 | [b (line 57): false] ... > ... | false | 65 | 9 | Conditions.cs:65:9:66:16 | [b (line 57): false] if (...) ... |
@@ -128,6 +126,8 @@
| 60 | 16 | Conditions.cs:60:16:60:22 | [b (line 57): true] ... > ... | true | 61 | 9 | Conditions.cs:61:9:64:9 | [b (line 57): true] {...} |
| 60 | 17 | BreakInTry.cs:60:17:60:28 | ... == ... | false | 64 | 9 | BreakInTry.cs:64:9:70:9 | {...} |
| 60 | 17 | BreakInTry.cs:60:17:60:28 | ... == ... | true | 61 | 17 | BreakInTry.cs:61:17:61:23 | return ...; |
| 61 | 13 | ExitMethods.cs:61:13:61:13 | access to parameter b | false | 64 | 41 | ExitMethods.cs:64:41:64:43 | "b" |
| 61 | 13 | ExitMethods.cs:61:13:61:13 | access to parameter b | true | 62 | 19 | ExitMethods.cs:62:19:62:33 | object creation of type Exception |
| 62 | 17 | Conditions.cs:62:17:62:17 | [b (line 57): false] access to parameter b | false | 60 | 16 | Conditions.cs:60:16:60:16 | [b (line 57): false] access to parameter x |
| 62 | 17 | Conditions.cs:62:17:62:17 | [b (line 57): true] access to parameter b | true | 63 | 17 | Conditions.cs:63:17:63:20 | [b (line 57): true] ...; |
| 62 | 17 | Conditions.cs:62:17:62:17 | access to parameter b | false | 60 | 16 | Conditions.cs:60:16:60:16 | [b (line 57): false] access to parameter x |
@@ -148,14 +148,10 @@
| 74 | 13 | cflow.cs:74:13:74:24 | ... > ... | true | 75 | 9 | cflow.cs:75:9:77:9 | {...} |
| 76 | 17 | Conditions.cs:76:17:76:17 | access to local variable b | false | 78 | 13 | Conditions.cs:78:13:79:26 | if (...) ... |
| 76 | 17 | Conditions.cs:76:17:76:17 | access to local variable b | true | 77 | 17 | Conditions.cs:77:17:77:20 | ...; |
| 78 | 16 | ExitMethods.cs:78:16:78:25 | ... != ... | false | 78 | 69 | ExitMethods.cs:78:69:78:75 | "input" |
| 78 | 16 | ExitMethods.cs:78:16:78:25 | ... != ... | true | 78 | 29 | ExitMethods.cs:78:29:78:29 | 1 |
| 78 | 17 | Conditions.cs:78:17:78:21 | ... > ... | false | 74 | 9 | Conditions.cs:74:9:80:9 | foreach (... ... in ...) ... |
| 78 | 17 | Conditions.cs:78:17:78:21 | ... > ... | true | 79 | 17 | Conditions.cs:79:17:79:26 | ...; |
| 81 | 12 | Conditions.cs:81:12:81:12 | access to local variable b | false | 83 | 16 | Conditions.cs:83:16:83:16 | access to local variable x |
| 81 | 12 | Conditions.cs:81:12:81:12 | access to local variable b | true | 82 | 13 | Conditions.cs:82:13:82:16 | ...; |
| 83 | 16 | ExitMethods.cs:83:16:83:30 | call to method Contains | false | 83 | 38 | ExitMethods.cs:83:38:83:38 | 1 |
| 83 | 16 | ExitMethods.cs:83:16:83:30 | call to method Contains | true | 83 | 34 | ExitMethods.cs:83:34:83:34 | 0 |
| 84 | 19 | Switch.cs:84:19:84:23 | ... > ... | false | 86 | 22 | Switch.cs:86:22:86:25 | true |
| 84 | 19 | Switch.cs:84:19:84:23 | ... > ... | true | 85 | 17 | Switch.cs:85:17:85:22 | break; |
| 86 | 13 | cflow.cs:86:13:86:21 | ... != ... | false | 84 | 18 | cflow.cs:84:18:84:19 | exit M2 |
@@ -164,6 +160,8 @@
| 86 | 26 | cflow.cs:86:26:86:37 | ... > ... | true | 87 | 13 | cflow.cs:87:13:87:33 | ...; |
| 92 | 13 | cflow.cs:92:13:92:27 | call to method Equals | false | 94 | 9 | cflow.cs:94:9:94:29 | ...; |
| 92 | 13 | cflow.cs:92:13:92:27 | call to method Equals | true | 93 | 45 | cflow.cs:93:45:93:47 | "s" |
| 92 | 16 | ExitMethods.cs:92:16:92:25 | ... != ... | false | 92 | 69 | ExitMethods.cs:92:69:92:75 | "input" |
| 92 | 16 | ExitMethods.cs:92:16:92:25 | ... != ... | true | 92 | 29 | ExitMethods.cs:92:29:92:29 | 1 |
| 92 | 17 | Conditions.cs:92:17:92:17 | access to local variable b | false | 94 | 13 | Conditions.cs:94:13:95:26 | if (...) ... |
| 92 | 17 | Conditions.cs:92:17:92:17 | access to local variable b | true | 93 | 17 | Conditions.cs:93:17:93:20 | ...; |
| 94 | 17 | Conditions.cs:94:17:94:21 | ... > ... | false | 96 | 13 | Conditions.cs:96:13:97:20 | if (...) ... |
@@ -172,6 +170,8 @@
| 96 | 13 | cflow.cs:96:13:96:25 | ... != ... | true | 97 | 13 | cflow.cs:97:13:97:55 | ...; |
| 96 | 17 | Conditions.cs:96:17:96:17 | access to local variable b | false | 90 | 9 | Conditions.cs:90:9:98:9 | foreach (... ... in ...) ... |
| 96 | 17 | Conditions.cs:96:17:96:17 | access to local variable b | true | 97 | 17 | Conditions.cs:97:17:97:20 | ...; |
| 97 | 16 | ExitMethods.cs:97:16:97:30 | call to method Contains | false | 97 | 38 | ExitMethods.cs:97:38:97:38 | 1 |
| 97 | 16 | ExitMethods.cs:97:16:97:30 | call to method Contains | true | 97 | 34 | ExitMethods.cs:97:34:97:34 | 0 |
| 99 | 13 | cflow.cs:99:13:99:25 | ... != ... | false | 102 | 9 | cflow.cs:102:9:103:36 | if (...) ... |
| 99 | 13 | cflow.cs:99:13:99:25 | ... != ... | true | 100 | 13 | cflow.cs:100:13:100:42 | ...; |
| 102 | 13 | cflow.cs:102:13:102:29 | ... != ... | false | 90 | 18 | cflow.cs:90:18:90:19 | exit M3 |

View File

@@ -621,92 +621,116 @@
| post | Conditions.cs:110:16:110:16 | access to local variable x | Conditions.cs:107:13:107:24 | [b (line 102): true] ... > ... |
| post | Conditions.cs:110:16:110:16 | access to local variable x | Conditions.cs:108:18:108:18 | [b (line 102): true] access to parameter b |
| post | Conditions.cs:110:16:110:16 | access to local variable x | Conditions.cs:109:17:109:23 | ... = ... |
| post | ExitMethods.cs:6:10:6:11 | exit M1 | ExitMethods.cs:9:9:9:15 | return ...; |
| post | ExitMethods.cs:7:5:10:5 | {...} | ExitMethods.cs:6:10:6:11 | enter M1 |
| post | ExitMethods.cs:8:9:8:24 | call to method ErrorMaybe | ExitMethods.cs:8:20:8:23 | true |
| post | ExitMethods.cs:8:9:8:25 | ...; | ExitMethods.cs:7:5:10:5 | {...} |
| post | ExitMethods.cs:8:20:8:23 | true | ExitMethods.cs:8:9:8:25 | ...; |
| post | ExitMethods.cs:9:9:9:15 | return ...; | ExitMethods.cs:8:9:8:24 | call to method ErrorMaybe |
| post | ExitMethods.cs:12:10:12:11 | exit M2 | ExitMethods.cs:15:9:15:15 | return ...; |
| post | ExitMethods.cs:13:5:16:5 | {...} | ExitMethods.cs:12:10:12:11 | enter M2 |
| post | ExitMethods.cs:14:9:14:25 | call to method ErrorMaybe | ExitMethods.cs:14:20:14:24 | false |
| post | ExitMethods.cs:14:9:14:26 | ...; | ExitMethods.cs:13:5:16:5 | {...} |
| post | ExitMethods.cs:14:20:14:24 | false | ExitMethods.cs:14:9:14:26 | ...; |
| post | ExitMethods.cs:15:9:15:15 | return ...; | ExitMethods.cs:14:9:14:25 | call to method ErrorMaybe |
| post | ExitMethods.cs:18:10:18:11 | exit M3 | ExitMethods.cs:20:9:20:25 | call to method ErrorAlways |
| post | ExitMethods.cs:19:5:22:5 | {...} | ExitMethods.cs:18:10:18:11 | enter M3 |
| post | ExitMethods.cs:20:9:20:25 | call to method ErrorAlways | ExitMethods.cs:20:21:20:24 | true |
| post | ExitMethods.cs:20:9:20:26 | ...; | ExitMethods.cs:19:5:22:5 | {...} |
| post | ExitMethods.cs:20:21:20:24 | true | ExitMethods.cs:20:9:20:26 | ...; |
| post | ExitMethods.cs:24:10:24:11 | exit M4 | ExitMethods.cs:26:9:26:14 | call to method Exit |
| post | ExitMethods.cs:25:5:28:5 | {...} | ExitMethods.cs:24:10:24:11 | enter M4 |
| post | ExitMethods.cs:26:9:26:14 | call to method Exit | ExitMethods.cs:26:9:26:14 | this access |
| post | ExitMethods.cs:26:9:26:14 | this access | ExitMethods.cs:26:9:26:15 | ...; |
| post | ExitMethods.cs:26:9:26:15 | ...; | ExitMethods.cs:25:5:28:5 | {...} |
| post | ExitMethods.cs:30:10:30:11 | exit M5 | ExitMethods.cs:32:9:32:25 | call to method ApplicationExit |
| post | ExitMethods.cs:31:5:34:5 | {...} | ExitMethods.cs:30:10:30:11 | enter M5 |
| post | ExitMethods.cs:32:9:32:25 | call to method ApplicationExit | ExitMethods.cs:32:9:32:25 | this access |
| post | ExitMethods.cs:32:9:32:25 | this access | ExitMethods.cs:32:9:32:26 | ...; |
| post | ExitMethods.cs:32:9:32:26 | ...; | ExitMethods.cs:31:5:34:5 | {...} |
| post | ExitMethods.cs:36:10:36:11 | exit M6 | ExitMethods.cs:44:13:44:19 | return ...; |
| post | ExitMethods.cs:36:10:36:11 | exit M6 | ExitMethods.cs:48:13:48:19 | return ...; |
| post | ExitMethods.cs:37:5:50:5 | {...} | ExitMethods.cs:36:10:36:11 | enter M6 |
| post | ExitMethods.cs:38:9:49:9 | try {...} ... | ExitMethods.cs:37:5:50:5 | {...} |
| post | ExitMethods.cs:39:9:41:9 | {...} | ExitMethods.cs:38:9:49:9 | try {...} ... |
| post | ExitMethods.cs:40:13:40:30 | call to method ErrorAlways | ExitMethods.cs:40:25:40:29 | false |
| post | ExitMethods.cs:40:13:40:31 | ...; | ExitMethods.cs:39:9:41:9 | {...} |
| post | ExitMethods.cs:40:25:40:29 | false | ExitMethods.cs:40:13:40:31 | ...; |
| post | ExitMethods.cs:43:9:45:9 | {...} | ExitMethods.cs:42:9:45:9 | [exception: ArgumentException] catch (...) {...} |
| post | ExitMethods.cs:44:13:44:19 | return ...; | ExitMethods.cs:43:9:45:9 | {...} |
| post | ExitMethods.cs:47:9:49:9 | {...} | ExitMethods.cs:46:9:49:9 | [exception: Exception] catch (...) {...} |
| post | ExitMethods.cs:48:13:48:19 | return ...; | ExitMethods.cs:47:9:49:9 | {...} |
| post | ExitMethods.cs:52:17:52:26 | exit ErrorMaybe | ExitMethods.cs:54:13:54:13 | access to parameter b |
| post | ExitMethods.cs:52:17:52:26 | exit ErrorMaybe | ExitMethods.cs:55:13:55:34 | throw ...; |
| post | ExitMethods.cs:53:5:56:5 | {...} | ExitMethods.cs:52:17:52:26 | enter ErrorMaybe |
| post | ExitMethods.cs:54:9:55:34 | if (...) ... | ExitMethods.cs:53:5:56:5 | {...} |
| post | ExitMethods.cs:54:13:54:13 | access to parameter b | ExitMethods.cs:54:9:55:34 | if (...) ... |
| post | ExitMethods.cs:55:13:55:34 | throw ...; | ExitMethods.cs:55:19:55:33 | object creation of type Exception |
| post | ExitMethods.cs:58:17:58:27 | exit ErrorAlways | ExitMethods.cs:61:13:61:34 | throw ...; |
| post | ExitMethods.cs:58:17:58:27 | exit ErrorAlways | ExitMethods.cs:63:13:63:45 | throw ...; |
| post | ExitMethods.cs:59:5:64:5 | {...} | ExitMethods.cs:58:17:58:27 | enter ErrorAlways |
| post | ExitMethods.cs:60:9:63:45 | if (...) ... | ExitMethods.cs:59:5:64:5 | {...} |
| post | ExitMethods.cs:60:13:60:13 | access to parameter b | ExitMethods.cs:60:9:63:45 | if (...) ... |
| post | ExitMethods.cs:61:13:61:34 | throw ...; | ExitMethods.cs:61:19:61:33 | object creation of type Exception |
| post | ExitMethods.cs:63:13:63:45 | throw ...; | ExitMethods.cs:63:19:63:44 | object creation of type ArgumentException |
| post | ExitMethods.cs:63:19:63:44 | object creation of type ArgumentException | ExitMethods.cs:63:41:63:43 | "b" |
| post | ExitMethods.cs:66:10:66:13 | exit Exit | ExitMethods.cs:68:9:68:27 | call to method Exit |
| post | ExitMethods.cs:67:5:69:5 | {...} | ExitMethods.cs:66:10:66:13 | enter Exit |
| post | ExitMethods.cs:68:9:68:27 | call to method Exit | ExitMethods.cs:68:26:68:26 | 0 |
| post | ExitMethods.cs:68:9:68:28 | ...; | ExitMethods.cs:67:5:69:5 | {...} |
| post | ExitMethods.cs:68:26:68:26 | 0 | ExitMethods.cs:68:9:68:28 | ...; |
| post | ExitMethods.cs:71:10:71:24 | exit ApplicationExit | ExitMethods.cs:73:9:73:47 | call to method Exit |
| post | ExitMethods.cs:72:5:74:5 | {...} | ExitMethods.cs:71:10:71:24 | enter ApplicationExit |
| post | ExitMethods.cs:73:9:73:47 | call to method Exit | ExitMethods.cs:73:9:73:48 | ...; |
| post | ExitMethods.cs:73:9:73:48 | ...; | ExitMethods.cs:72:5:74:5 | {...} |
| post | ExitMethods.cs:76:13:76:21 | exit ThrowExpr | ExitMethods.cs:78:9:78:77 | return ...; |
| post | ExitMethods.cs:76:13:76:21 | exit ThrowExpr | ExitMethods.cs:78:41:78:76 | throw ... |
| post | ExitMethods.cs:77:5:79:5 | {...} | ExitMethods.cs:76:13:76:21 | enter ThrowExpr |
| post | ExitMethods.cs:78:9:78:77 | return ...; | ExitMethods.cs:78:29:78:37 | ... / ... |
| post | ExitMethods.cs:78:16:78:20 | access to parameter input | ExitMethods.cs:78:16:78:76 | ... ? ... : ... |
| post | ExitMethods.cs:78:16:78:25 | ... != ... | ExitMethods.cs:78:25:78:25 | (...) ... |
| post | ExitMethods.cs:78:16:78:76 | ... ? ... : ... | ExitMethods.cs:77:5:79:5 | {...} |
| post | ExitMethods.cs:78:25:78:25 | 0 | ExitMethods.cs:78:16:78:20 | access to parameter input |
| post | ExitMethods.cs:78:25:78:25 | (...) ... | ExitMethods.cs:78:25:78:25 | 0 |
| post | ExitMethods.cs:78:29:78:29 | (...) ... | ExitMethods.cs:78:29:78:29 | 1 |
| post | ExitMethods.cs:78:29:78:37 | ... / ... | ExitMethods.cs:78:33:78:37 | access to parameter input |
| post | ExitMethods.cs:78:33:78:37 | access to parameter input | ExitMethods.cs:78:29:78:29 | (...) ... |
| post | ExitMethods.cs:78:41:78:76 | throw ... | ExitMethods.cs:78:47:78:76 | object creation of type ArgumentException |
| post | ExitMethods.cs:78:47:78:76 | object creation of type ArgumentException | ExitMethods.cs:78:69:78:75 | "input" |
| post | ExitMethods.cs:81:16:81:34 | exit ExtensionMethodCall | ExitMethods.cs:83:9:83:39 | return ...; |
| post | ExitMethods.cs:82:5:84:5 | {...} | ExitMethods.cs:81:16:81:34 | enter ExtensionMethodCall |
| post | ExitMethods.cs:83:9:83:39 | return ...; | ExitMethods.cs:83:34:83:34 | 0 |
| post | ExitMethods.cs:83:9:83:39 | return ...; | ExitMethods.cs:83:38:83:38 | 1 |
| post | ExitMethods.cs:83:16:83:16 | access to parameter s | ExitMethods.cs:83:16:83:38 | ... ? ... : ... |
| post | ExitMethods.cs:83:16:83:30 | call to method Contains | ExitMethods.cs:83:27:83:29 | - |
| post | ExitMethods.cs:83:16:83:38 | ... ? ... : ... | ExitMethods.cs:82:5:84:5 | {...} |
| post | ExitMethods.cs:83:27:83:29 | - | ExitMethods.cs:83:16:83:16 | access to parameter s |
| post | ExitMethods.cs:91:28:91:31 | exit Exit | ExitMethods.cs:91:35:91:37 | {...} |
| post | ExitMethods.cs:91:35:91:37 | {...} | ExitMethods.cs:91:28:91:31 | enter Exit |
| post | ExitMethods.cs:7:10:7:11 | exit M1 | ExitMethods.cs:10:9:10:15 | return ...; |
| post | ExitMethods.cs:8:5:11:5 | {...} | ExitMethods.cs:7:10:7:11 | enter M1 |
| post | ExitMethods.cs:9:9:9:24 | call to method ErrorMaybe | ExitMethods.cs:9:20:9:23 | true |
| post | ExitMethods.cs:9:9:9:25 | ...; | ExitMethods.cs:8:5:11:5 | {...} |
| post | ExitMethods.cs:9:20:9:23 | true | ExitMethods.cs:9:9:9:25 | ...; |
| post | ExitMethods.cs:10:9:10:15 | return ...; | ExitMethods.cs:9:9:9:24 | call to method ErrorMaybe |
| post | ExitMethods.cs:13:10:13:11 | exit M2 | ExitMethods.cs:16:9:16:15 | return ...; |
| post | ExitMethods.cs:14:5:17:5 | {...} | ExitMethods.cs:13:10:13:11 | enter M2 |
| post | ExitMethods.cs:15:9:15:25 | call to method ErrorMaybe | ExitMethods.cs:15:20:15:24 | false |
| post | ExitMethods.cs:15:9:15:26 | ...; | ExitMethods.cs:14:5:17:5 | {...} |
| post | ExitMethods.cs:15:20:15:24 | false | ExitMethods.cs:15:9:15:26 | ...; |
| post | ExitMethods.cs:16:9:16:15 | return ...; | ExitMethods.cs:15:9:15:25 | call to method ErrorMaybe |
| post | ExitMethods.cs:19:10:19:11 | exit M3 | ExitMethods.cs:21:9:21:25 | call to method ErrorAlways |
| post | ExitMethods.cs:20:5:23:5 | {...} | ExitMethods.cs:19:10:19:11 | enter M3 |
| post | ExitMethods.cs:21:9:21:25 | call to method ErrorAlways | ExitMethods.cs:21:21:21:24 | true |
| post | ExitMethods.cs:21:9:21:26 | ...; | ExitMethods.cs:20:5:23:5 | {...} |
| post | ExitMethods.cs:21:21:21:24 | true | ExitMethods.cs:21:9:21:26 | ...; |
| post | ExitMethods.cs:25:10:25:11 | exit M4 | ExitMethods.cs:27:9:27:14 | call to method Exit |
| post | ExitMethods.cs:26:5:29:5 | {...} | ExitMethods.cs:25:10:25:11 | enter M4 |
| post | ExitMethods.cs:27:9:27:14 | call to method Exit | ExitMethods.cs:27:9:27:14 | this access |
| post | ExitMethods.cs:27:9:27:14 | this access | ExitMethods.cs:27:9:27:15 | ...; |
| post | ExitMethods.cs:27:9:27:15 | ...; | ExitMethods.cs:26:5:29:5 | {...} |
| post | ExitMethods.cs:31:10:31:11 | exit M5 | ExitMethods.cs:33:9:33:25 | call to method ApplicationExit |
| post | ExitMethods.cs:32:5:35:5 | {...} | ExitMethods.cs:31:10:31:11 | enter M5 |
| post | ExitMethods.cs:33:9:33:25 | call to method ApplicationExit | ExitMethods.cs:33:9:33:25 | this access |
| post | ExitMethods.cs:33:9:33:25 | this access | ExitMethods.cs:33:9:33:26 | ...; |
| post | ExitMethods.cs:33:9:33:26 | ...; | ExitMethods.cs:32:5:35:5 | {...} |
| post | ExitMethods.cs:37:10:37:11 | exit M6 | ExitMethods.cs:45:13:45:19 | return ...; |
| post | ExitMethods.cs:37:10:37:11 | exit M6 | ExitMethods.cs:49:13:49:19 | return ...; |
| post | ExitMethods.cs:38:5:51:5 | {...} | ExitMethods.cs:37:10:37:11 | enter M6 |
| post | ExitMethods.cs:39:9:50:9 | try {...} ... | ExitMethods.cs:38:5:51:5 | {...} |
| post | ExitMethods.cs:40:9:42:9 | {...} | ExitMethods.cs:39:9:50:9 | try {...} ... |
| post | ExitMethods.cs:41:13:41:30 | call to method ErrorAlways | ExitMethods.cs:41:25:41:29 | false |
| post | ExitMethods.cs:41:13:41:31 | ...; | ExitMethods.cs:40:9:42:9 | {...} |
| post | ExitMethods.cs:41:25:41:29 | false | ExitMethods.cs:41:13:41:31 | ...; |
| post | ExitMethods.cs:44:9:46:9 | {...} | ExitMethods.cs:43:9:46:9 | [exception: ArgumentException] catch (...) {...} |
| post | ExitMethods.cs:45:13:45:19 | return ...; | ExitMethods.cs:44:9:46:9 | {...} |
| post | ExitMethods.cs:48:9:50:9 | {...} | ExitMethods.cs:47:9:50:9 | [exception: Exception] catch (...) {...} |
| post | ExitMethods.cs:49:13:49:19 | return ...; | ExitMethods.cs:48:9:50:9 | {...} |
| post | ExitMethods.cs:53:17:53:26 | exit ErrorMaybe | ExitMethods.cs:55:13:55:13 | access to parameter b |
| post | ExitMethods.cs:53:17:53:26 | exit ErrorMaybe | ExitMethods.cs:56:13:56:34 | throw ...; |
| post | ExitMethods.cs:54:5:57:5 | {...} | ExitMethods.cs:53:17:53:26 | enter ErrorMaybe |
| post | ExitMethods.cs:55:9:56:34 | if (...) ... | ExitMethods.cs:54:5:57:5 | {...} |
| post | ExitMethods.cs:55:13:55:13 | access to parameter b | ExitMethods.cs:55:9:56:34 | if (...) ... |
| post | ExitMethods.cs:56:13:56:34 | throw ...; | ExitMethods.cs:56:19:56:33 | object creation of type Exception |
| post | ExitMethods.cs:59:17:59:27 | exit ErrorAlways | ExitMethods.cs:62:13:62:34 | throw ...; |
| post | ExitMethods.cs:59:17:59:27 | exit ErrorAlways | ExitMethods.cs:64:13:64:45 | throw ...; |
| post | ExitMethods.cs:60:5:65:5 | {...} | ExitMethods.cs:59:17:59:27 | enter ErrorAlways |
| post | ExitMethods.cs:61:9:64:45 | if (...) ... | ExitMethods.cs:60:5:65:5 | {...} |
| post | ExitMethods.cs:61:13:61:13 | access to parameter b | ExitMethods.cs:61:9:64:45 | if (...) ... |
| post | ExitMethods.cs:62:13:62:34 | throw ...; | ExitMethods.cs:62:19:62:33 | object creation of type Exception |
| post | ExitMethods.cs:64:13:64:45 | throw ...; | ExitMethods.cs:64:19:64:44 | object creation of type ArgumentException |
| post | ExitMethods.cs:64:19:64:44 | object creation of type ArgumentException | ExitMethods.cs:64:41:64:43 | "b" |
| post | ExitMethods.cs:67:10:67:13 | exit Exit | ExitMethods.cs:69:9:69:27 | call to method Exit |
| post | ExitMethods.cs:68:5:70:5 | {...} | ExitMethods.cs:67:10:67:13 | enter Exit |
| post | ExitMethods.cs:69:9:69:27 | call to method Exit | ExitMethods.cs:69:26:69:26 | 0 |
| post | ExitMethods.cs:69:9:69:28 | ...; | ExitMethods.cs:68:5:70:5 | {...} |
| post | ExitMethods.cs:69:26:69:26 | 0 | ExitMethods.cs:69:9:69:28 | ...; |
| post | ExitMethods.cs:72:10:72:18 | exit ExitInTry | ExitMethods.cs:76:13:76:18 | call to method Exit |
| post | ExitMethods.cs:73:5:83:5 | {...} | ExitMethods.cs:72:10:72:18 | enter ExitInTry |
| post | ExitMethods.cs:74:9:82:9 | try {...} ... | ExitMethods.cs:73:5:83:5 | {...} |
| post | ExitMethods.cs:75:9:77:9 | {...} | ExitMethods.cs:74:9:82:9 | try {...} ... |
| post | ExitMethods.cs:76:13:76:18 | call to method Exit | ExitMethods.cs:76:13:76:18 | this access |
| post | ExitMethods.cs:76:13:76:18 | this access | ExitMethods.cs:76:13:76:19 | ...; |
| post | ExitMethods.cs:76:13:76:19 | ...; | ExitMethods.cs:75:9:77:9 | {...} |
| post | ExitMethods.cs:85:10:85:24 | exit ApplicationExit | ExitMethods.cs:87:9:87:47 | call to method Exit |
| post | ExitMethods.cs:86:5:88:5 | {...} | ExitMethods.cs:85:10:85:24 | enter ApplicationExit |
| post | ExitMethods.cs:87:9:87:47 | call to method Exit | ExitMethods.cs:87:9:87:48 | ...; |
| post | ExitMethods.cs:87:9:87:48 | ...; | ExitMethods.cs:86:5:88:5 | {...} |
| post | ExitMethods.cs:90:13:90:21 | exit ThrowExpr | ExitMethods.cs:92:9:92:77 | return ...; |
| post | ExitMethods.cs:90:13:90:21 | exit ThrowExpr | ExitMethods.cs:92:41:92:76 | throw ... |
| post | ExitMethods.cs:91:5:93:5 | {...} | ExitMethods.cs:90:13:90:21 | enter ThrowExpr |
| post | ExitMethods.cs:92:9:92:77 | return ...; | ExitMethods.cs:92:29:92:37 | ... / ... |
| post | ExitMethods.cs:92:16:92:20 | access to parameter input | ExitMethods.cs:92:16:92:76 | ... ? ... : ... |
| post | ExitMethods.cs:92:16:92:25 | ... != ... | ExitMethods.cs:92:25:92:25 | (...) ... |
| post | ExitMethods.cs:92:16:92:76 | ... ? ... : ... | ExitMethods.cs:91:5:93:5 | {...} |
| post | ExitMethods.cs:92:25:92:25 | 0 | ExitMethods.cs:92:16:92:20 | access to parameter input |
| post | ExitMethods.cs:92:25:92:25 | (...) ... | ExitMethods.cs:92:25:92:25 | 0 |
| post | ExitMethods.cs:92:29:92:29 | (...) ... | ExitMethods.cs:92:29:92:29 | 1 |
| post | ExitMethods.cs:92:29:92:37 | ... / ... | ExitMethods.cs:92:33:92:37 | access to parameter input |
| post | ExitMethods.cs:92:33:92:37 | access to parameter input | ExitMethods.cs:92:29:92:29 | (...) ... |
| post | ExitMethods.cs:92:41:92:76 | throw ... | ExitMethods.cs:92:47:92:76 | object creation of type ArgumentException |
| post | ExitMethods.cs:92:47:92:76 | object creation of type ArgumentException | ExitMethods.cs:92:69:92:75 | "input" |
| post | ExitMethods.cs:95:16:95:34 | exit ExtensionMethodCall | ExitMethods.cs:97:9:97:39 | return ...; |
| post | ExitMethods.cs:96:5:98:5 | {...} | ExitMethods.cs:95:16:95:34 | enter ExtensionMethodCall |
| post | ExitMethods.cs:97:9:97:39 | return ...; | ExitMethods.cs:97:34:97:34 | 0 |
| post | ExitMethods.cs:97:9:97:39 | return ...; | ExitMethods.cs:97:38:97:38 | 1 |
| post | ExitMethods.cs:97:16:97:16 | access to parameter s | ExitMethods.cs:97:16:97:38 | ... ? ... : ... |
| post | ExitMethods.cs:97:16:97:30 | call to method Contains | ExitMethods.cs:97:27:97:29 | - |
| post | ExitMethods.cs:97:16:97:38 | ... ? ... : ... | ExitMethods.cs:96:5:98:5 | {...} |
| post | ExitMethods.cs:97:27:97:29 | - | ExitMethods.cs:97:16:97:16 | access to parameter s |
| post | ExitMethods.cs:100:17:100:32 | exit FailingAssertion | ExitMethods.cs:102:9:102:28 | call to method IsTrue |
| post | ExitMethods.cs:101:5:104:5 | {...} | ExitMethods.cs:100:17:100:32 | enter FailingAssertion |
| post | ExitMethods.cs:102:9:102:28 | call to method IsTrue | ExitMethods.cs:102:23:102:27 | false |
| post | ExitMethods.cs:102:9:102:29 | ...; | ExitMethods.cs:101:5:104:5 | {...} |
| post | ExitMethods.cs:102:23:102:27 | false | ExitMethods.cs:102:9:102:29 | ...; |
| post | ExitMethods.cs:106:17:106:33 | exit FailingAssertion2 | ExitMethods.cs:108:9:108:26 | call to method FailingAssertion |
| post | ExitMethods.cs:107:5:110:5 | {...} | ExitMethods.cs:106:17:106:33 | enter FailingAssertion2 |
| post | ExitMethods.cs:108:9:108:26 | call to method FailingAssertion | ExitMethods.cs:108:9:108:26 | this access |
| post | ExitMethods.cs:108:9:108:26 | this access | ExitMethods.cs:108:9:108:27 | ...; |
| post | ExitMethods.cs:108:9:108:27 | ...; | ExitMethods.cs:107:5:110:5 | {...} |
| post | ExitMethods.cs:112:10:112:20 | exit AssertFalse | ExitMethods.cs:112:33:112:49 | call to method IsFalse |
| post | ExitMethods.cs:112:33:112:49 | call to method IsFalse | ExitMethods.cs:112:48:112:48 | access to parameter b |
| post | ExitMethods.cs:112:48:112:48 | access to parameter b | ExitMethods.cs:112:10:112:20 | enter AssertFalse |
| post | ExitMethods.cs:114:17:114:33 | exit FailingAssertion3 | ExitMethods.cs:116:9:116:25 | call to method AssertFalse |
| post | ExitMethods.cs:115:5:118:5 | {...} | ExitMethods.cs:114:17:114:33 | enter FailingAssertion3 |
| post | ExitMethods.cs:116:9:116:25 | call to method AssertFalse | ExitMethods.cs:116:21:116:24 | true |
| post | ExitMethods.cs:116:9:116:25 | this access | ExitMethods.cs:116:9:116:26 | ...; |
| post | ExitMethods.cs:116:9:116:26 | ...; | ExitMethods.cs:115:5:118:5 | {...} |
| post | ExitMethods.cs:116:21:116:24 | true | ExitMethods.cs:116:9:116:25 | this access |
| post | Extensions.cs:5:23:5:29 | exit ToInt32 | Extensions.cs:7:9:7:30 | return ...; |
| post | Extensions.cs:6:5:8:5 | {...} | Extensions.cs:5:23:5:29 | enter ToInt32 |
| post | Extensions.cs:7:9:7:30 | return ...; | Extensions.cs:7:16:7:29 | call to method Parse |
@@ -2724,92 +2748,116 @@
| pre | Conditions.cs:109:22:109:23 | "" | Conditions.cs:109:17:109:23 | ... + ... |
| pre | Conditions.cs:110:9:110:17 | return ...; | Conditions.cs:102:12:102:13 | exit M8 |
| pre | Conditions.cs:110:16:110:16 | access to local variable x | Conditions.cs:110:9:110:17 | return ...; |
| pre | ExitMethods.cs:6:10:6:11 | enter M1 | ExitMethods.cs:7:5:10:5 | {...} |
| pre | ExitMethods.cs:7:5:10:5 | {...} | ExitMethods.cs:8:9:8:25 | ...; |
| pre | ExitMethods.cs:8:9:8:24 | call to method ErrorMaybe | ExitMethods.cs:9:9:9:15 | return ...; |
| pre | ExitMethods.cs:8:9:8:25 | ...; | ExitMethods.cs:8:20:8:23 | true |
| pre | ExitMethods.cs:8:20:8:23 | true | ExitMethods.cs:8:9:8:24 | call to method ErrorMaybe |
| pre | ExitMethods.cs:9:9:9:15 | return ...; | ExitMethods.cs:6:10:6:11 | exit M1 |
| pre | ExitMethods.cs:12:10:12:11 | enter M2 | ExitMethods.cs:13:5:16:5 | {...} |
| pre | ExitMethods.cs:13:5:16:5 | {...} | ExitMethods.cs:14:9:14:26 | ...; |
| pre | ExitMethods.cs:14:9:14:25 | call to method ErrorMaybe | ExitMethods.cs:15:9:15:15 | return ...; |
| pre | ExitMethods.cs:14:9:14:26 | ...; | ExitMethods.cs:14:20:14:24 | false |
| pre | ExitMethods.cs:14:20:14:24 | false | ExitMethods.cs:14:9:14:25 | call to method ErrorMaybe |
| pre | ExitMethods.cs:15:9:15:15 | return ...; | ExitMethods.cs:12:10:12:11 | exit M2 |
| pre | ExitMethods.cs:18:10:18:11 | enter M3 | ExitMethods.cs:19:5:22:5 | {...} |
| pre | ExitMethods.cs:19:5:22:5 | {...} | ExitMethods.cs:20:9:20:26 | ...; |
| pre | ExitMethods.cs:20:9:20:25 | call to method ErrorAlways | ExitMethods.cs:18:10:18:11 | exit M3 |
| pre | ExitMethods.cs:20:9:20:26 | ...; | ExitMethods.cs:20:21:20:24 | true |
| pre | ExitMethods.cs:20:21:20:24 | true | ExitMethods.cs:20:9:20:25 | call to method ErrorAlways |
| pre | ExitMethods.cs:24:10:24:11 | enter M4 | ExitMethods.cs:25:5:28:5 | {...} |
| pre | ExitMethods.cs:25:5:28:5 | {...} | ExitMethods.cs:26:9:26:15 | ...; |
| pre | ExitMethods.cs:26:9:26:14 | call to method Exit | ExitMethods.cs:24:10:24:11 | exit M4 |
| pre | ExitMethods.cs:26:9:26:14 | this access | ExitMethods.cs:26:9:26:14 | call to method Exit |
| pre | ExitMethods.cs:26:9:26:15 | ...; | ExitMethods.cs:26:9:26:14 | this access |
| pre | ExitMethods.cs:30:10:30:11 | enter M5 | ExitMethods.cs:31:5:34:5 | {...} |
| pre | ExitMethods.cs:31:5:34:5 | {...} | ExitMethods.cs:32:9:32:26 | ...; |
| pre | ExitMethods.cs:32:9:32:25 | call to method ApplicationExit | ExitMethods.cs:30:10:30:11 | exit M5 |
| pre | ExitMethods.cs:32:9:32:25 | this access | ExitMethods.cs:32:9:32:25 | call to method ApplicationExit |
| pre | ExitMethods.cs:32:9:32:26 | ...; | ExitMethods.cs:32:9:32:25 | this access |
| pre | ExitMethods.cs:36:10:36:11 | enter M6 | ExitMethods.cs:37:5:50:5 | {...} |
| pre | ExitMethods.cs:37:5:50:5 | {...} | ExitMethods.cs:38:9:49:9 | try {...} ... |
| pre | ExitMethods.cs:38:9:49:9 | try {...} ... | ExitMethods.cs:39:9:41:9 | {...} |
| pre | ExitMethods.cs:39:9:41:9 | {...} | ExitMethods.cs:40:13:40:31 | ...; |
| pre | ExitMethods.cs:40:13:40:30 | call to method ErrorAlways | ExitMethods.cs:42:9:45:9 | [exception: ArgumentException] catch (...) {...} |
| pre | ExitMethods.cs:40:13:40:30 | call to method ErrorAlways | ExitMethods.cs:42:9:45:9 | [exception: Exception] catch (...) {...} |
| pre | ExitMethods.cs:40:13:40:31 | ...; | ExitMethods.cs:40:25:40:29 | false |
| pre | ExitMethods.cs:40:25:40:29 | false | ExitMethods.cs:40:13:40:30 | call to method ErrorAlways |
| pre | ExitMethods.cs:42:9:45:9 | [exception: Exception] catch (...) {...} | ExitMethods.cs:46:9:49:9 | [exception: Exception] catch (...) {...} |
| pre | ExitMethods.cs:43:9:45:9 | {...} | ExitMethods.cs:44:13:44:19 | return ...; |
| pre | ExitMethods.cs:46:9:49:9 | [exception: Exception] catch (...) {...} | ExitMethods.cs:47:9:49:9 | {...} |
| pre | ExitMethods.cs:47:9:49:9 | {...} | ExitMethods.cs:48:13:48:19 | return ...; |
| pre | ExitMethods.cs:52:17:52:26 | enter ErrorMaybe | ExitMethods.cs:53:5:56:5 | {...} |
| pre | ExitMethods.cs:53:5:56:5 | {...} | ExitMethods.cs:54:9:55:34 | if (...) ... |
| pre | ExitMethods.cs:54:9:55:34 | if (...) ... | ExitMethods.cs:54:13:54:13 | access to parameter b |
| pre | ExitMethods.cs:54:13:54:13 | access to parameter b | ExitMethods.cs:52:17:52:26 | exit ErrorMaybe |
| pre | ExitMethods.cs:54:13:54:13 | access to parameter b | ExitMethods.cs:55:19:55:33 | object creation of type Exception |
| pre | ExitMethods.cs:55:19:55:33 | object creation of type Exception | ExitMethods.cs:55:13:55:34 | throw ...; |
| pre | ExitMethods.cs:58:17:58:27 | enter ErrorAlways | ExitMethods.cs:59:5:64:5 | {...} |
| pre | ExitMethods.cs:59:5:64:5 | {...} | ExitMethods.cs:60:9:63:45 | if (...) ... |
| pre | ExitMethods.cs:60:9:63:45 | if (...) ... | ExitMethods.cs:60:13:60:13 | access to parameter b |
| pre | ExitMethods.cs:60:13:60:13 | access to parameter b | ExitMethods.cs:61:19:61:33 | object creation of type Exception |
| pre | ExitMethods.cs:60:13:60:13 | access to parameter b | ExitMethods.cs:63:41:63:43 | "b" |
| pre | ExitMethods.cs:61:19:61:33 | object creation of type Exception | ExitMethods.cs:61:13:61:34 | throw ...; |
| pre | ExitMethods.cs:63:19:63:44 | object creation of type ArgumentException | ExitMethods.cs:63:13:63:45 | throw ...; |
| pre | ExitMethods.cs:63:41:63:43 | "b" | ExitMethods.cs:63:19:63:44 | object creation of type ArgumentException |
| pre | ExitMethods.cs:66:10:66:13 | enter Exit | ExitMethods.cs:67:5:69:5 | {...} |
| pre | ExitMethods.cs:67:5:69:5 | {...} | ExitMethods.cs:68:9:68:28 | ...; |
| pre | ExitMethods.cs:68:9:68:27 | call to method Exit | ExitMethods.cs:66:10:66:13 | exit Exit |
| pre | ExitMethods.cs:68:9:68:28 | ...; | ExitMethods.cs:68:26:68:26 | 0 |
| pre | ExitMethods.cs:68:26:68:26 | 0 | ExitMethods.cs:68:9:68:27 | call to method Exit |
| pre | ExitMethods.cs:71:10:71:24 | enter ApplicationExit | ExitMethods.cs:72:5:74:5 | {...} |
| pre | ExitMethods.cs:72:5:74:5 | {...} | ExitMethods.cs:73:9:73:48 | ...; |
| pre | ExitMethods.cs:73:9:73:47 | call to method Exit | ExitMethods.cs:71:10:71:24 | exit ApplicationExit |
| pre | ExitMethods.cs:73:9:73:48 | ...; | ExitMethods.cs:73:9:73:47 | call to method Exit |
| pre | ExitMethods.cs:76:13:76:21 | enter ThrowExpr | ExitMethods.cs:77:5:79:5 | {...} |
| pre | ExitMethods.cs:77:5:79:5 | {...} | ExitMethods.cs:78:16:78:76 | ... ? ... : ... |
| pre | ExitMethods.cs:78:16:78:20 | access to parameter input | ExitMethods.cs:78:25:78:25 | 0 |
| pre | ExitMethods.cs:78:16:78:25 | ... != ... | ExitMethods.cs:78:29:78:29 | 1 |
| pre | ExitMethods.cs:78:16:78:25 | ... != ... | ExitMethods.cs:78:69:78:75 | "input" |
| pre | ExitMethods.cs:78:16:78:76 | ... ? ... : ... | ExitMethods.cs:78:16:78:20 | access to parameter input |
| pre | ExitMethods.cs:78:25:78:25 | 0 | ExitMethods.cs:78:25:78:25 | (...) ... |
| pre | ExitMethods.cs:78:25:78:25 | (...) ... | ExitMethods.cs:78:16:78:25 | ... != ... |
| pre | ExitMethods.cs:78:29:78:29 | 1 | ExitMethods.cs:78:29:78:29 | (...) ... |
| pre | ExitMethods.cs:78:29:78:29 | (...) ... | ExitMethods.cs:78:33:78:37 | access to parameter input |
| pre | ExitMethods.cs:78:29:78:37 | ... / ... | ExitMethods.cs:78:9:78:77 | return ...; |
| pre | ExitMethods.cs:78:33:78:37 | access to parameter input | ExitMethods.cs:78:29:78:37 | ... / ... |
| pre | ExitMethods.cs:78:47:78:76 | object creation of type ArgumentException | ExitMethods.cs:78:41:78:76 | throw ... |
| pre | ExitMethods.cs:78:69:78:75 | "input" | ExitMethods.cs:78:47:78:76 | object creation of type ArgumentException |
| pre | ExitMethods.cs:81:16:81:34 | enter ExtensionMethodCall | ExitMethods.cs:82:5:84:5 | {...} |
| pre | ExitMethods.cs:82:5:84:5 | {...} | ExitMethods.cs:83:16:83:38 | ... ? ... : ... |
| pre | ExitMethods.cs:83:9:83:39 | return ...; | ExitMethods.cs:81:16:81:34 | exit ExtensionMethodCall |
| pre | ExitMethods.cs:83:16:83:16 | access to parameter s | ExitMethods.cs:83:27:83:29 | - |
| pre | ExitMethods.cs:83:16:83:30 | call to method Contains | ExitMethods.cs:83:34:83:34 | 0 |
| pre | ExitMethods.cs:83:16:83:30 | call to method Contains | ExitMethods.cs:83:38:83:38 | 1 |
| pre | ExitMethods.cs:83:16:83:38 | ... ? ... : ... | ExitMethods.cs:83:16:83:16 | access to parameter s |
| pre | ExitMethods.cs:83:27:83:29 | - | ExitMethods.cs:83:16:83:30 | call to method Contains |
| pre | ExitMethods.cs:91:28:91:31 | enter Exit | ExitMethods.cs:91:35:91:37 | {...} |
| pre | ExitMethods.cs:91:35:91:37 | {...} | ExitMethods.cs:91:28:91:31 | exit Exit |
| pre | ExitMethods.cs:7:10:7:11 | enter M1 | ExitMethods.cs:8:5:11:5 | {...} |
| pre | ExitMethods.cs:8:5:11:5 | {...} | ExitMethods.cs:9:9:9:25 | ...; |
| pre | ExitMethods.cs:9:9:9:24 | call to method ErrorMaybe | ExitMethods.cs:10:9:10:15 | return ...; |
| pre | ExitMethods.cs:9:9:9:25 | ...; | ExitMethods.cs:9:20:9:23 | true |
| pre | ExitMethods.cs:9:20:9:23 | true | ExitMethods.cs:9:9:9:24 | call to method ErrorMaybe |
| pre | ExitMethods.cs:10:9:10:15 | return ...; | ExitMethods.cs:7:10:7:11 | exit M1 |
| pre | ExitMethods.cs:13:10:13:11 | enter M2 | ExitMethods.cs:14:5:17:5 | {...} |
| pre | ExitMethods.cs:14:5:17:5 | {...} | ExitMethods.cs:15:9:15:26 | ...; |
| pre | ExitMethods.cs:15:9:15:25 | call to method ErrorMaybe | ExitMethods.cs:16:9:16:15 | return ...; |
| pre | ExitMethods.cs:15:9:15:26 | ...; | ExitMethods.cs:15:20:15:24 | false |
| pre | ExitMethods.cs:15:20:15:24 | false | ExitMethods.cs:15:9:15:25 | call to method ErrorMaybe |
| pre | ExitMethods.cs:16:9:16:15 | return ...; | ExitMethods.cs:13:10:13:11 | exit M2 |
| pre | ExitMethods.cs:19:10:19:11 | enter M3 | ExitMethods.cs:20:5:23:5 | {...} |
| pre | ExitMethods.cs:20:5:23:5 | {...} | ExitMethods.cs:21:9:21:26 | ...; |
| pre | ExitMethods.cs:21:9:21:25 | call to method ErrorAlways | ExitMethods.cs:19:10:19:11 | exit M3 |
| pre | ExitMethods.cs:21:9:21:26 | ...; | ExitMethods.cs:21:21:21:24 | true |
| pre | ExitMethods.cs:21:21:21:24 | true | ExitMethods.cs:21:9:21:25 | call to method ErrorAlways |
| pre | ExitMethods.cs:25:10:25:11 | enter M4 | ExitMethods.cs:26:5:29:5 | {...} |
| pre | ExitMethods.cs:26:5:29:5 | {...} | ExitMethods.cs:27:9:27:15 | ...; |
| pre | ExitMethods.cs:27:9:27:14 | call to method Exit | ExitMethods.cs:25:10:25:11 | exit M4 |
| pre | ExitMethods.cs:27:9:27:14 | this access | ExitMethods.cs:27:9:27:14 | call to method Exit |
| pre | ExitMethods.cs:27:9:27:15 | ...; | ExitMethods.cs:27:9:27:14 | this access |
| pre | ExitMethods.cs:31:10:31:11 | enter M5 | ExitMethods.cs:32:5:35:5 | {...} |
| pre | ExitMethods.cs:32:5:35:5 | {...} | ExitMethods.cs:33:9:33:26 | ...; |
| pre | ExitMethods.cs:33:9:33:25 | call to method ApplicationExit | ExitMethods.cs:31:10:31:11 | exit M5 |
| pre | ExitMethods.cs:33:9:33:25 | this access | ExitMethods.cs:33:9:33:25 | call to method ApplicationExit |
| pre | ExitMethods.cs:33:9:33:26 | ...; | ExitMethods.cs:33:9:33:25 | this access |
| pre | ExitMethods.cs:37:10:37:11 | enter M6 | ExitMethods.cs:38:5:51:5 | {...} |
| pre | ExitMethods.cs:38:5:51:5 | {...} | ExitMethods.cs:39:9:50:9 | try {...} ... |
| pre | ExitMethods.cs:39:9:50:9 | try {...} ... | ExitMethods.cs:40:9:42:9 | {...} |
| pre | ExitMethods.cs:40:9:42:9 | {...} | ExitMethods.cs:41:13:41:31 | ...; |
| pre | ExitMethods.cs:41:13:41:30 | call to method ErrorAlways | ExitMethods.cs:43:9:46:9 | [exception: ArgumentException] catch (...) {...} |
| pre | ExitMethods.cs:41:13:41:30 | call to method ErrorAlways | ExitMethods.cs:43:9:46:9 | [exception: Exception] catch (...) {...} |
| pre | ExitMethods.cs:41:13:41:31 | ...; | ExitMethods.cs:41:25:41:29 | false |
| pre | ExitMethods.cs:41:25:41:29 | false | ExitMethods.cs:41:13:41:30 | call to method ErrorAlways |
| pre | ExitMethods.cs:43:9:46:9 | [exception: Exception] catch (...) {...} | ExitMethods.cs:47:9:50:9 | [exception: Exception] catch (...) {...} |
| pre | ExitMethods.cs:44:9:46:9 | {...} | ExitMethods.cs:45:13:45:19 | return ...; |
| pre | ExitMethods.cs:47:9:50:9 | [exception: Exception] catch (...) {...} | ExitMethods.cs:48:9:50:9 | {...} |
| pre | ExitMethods.cs:48:9:50:9 | {...} | ExitMethods.cs:49:13:49:19 | return ...; |
| pre | ExitMethods.cs:53:17:53:26 | enter ErrorMaybe | ExitMethods.cs:54:5:57:5 | {...} |
| pre | ExitMethods.cs:54:5:57:5 | {...} | ExitMethods.cs:55:9:56:34 | if (...) ... |
| pre | ExitMethods.cs:55:9:56:34 | if (...) ... | ExitMethods.cs:55:13:55:13 | access to parameter b |
| pre | ExitMethods.cs:55:13:55:13 | access to parameter b | ExitMethods.cs:53:17:53:26 | exit ErrorMaybe |
| pre | ExitMethods.cs:55:13:55:13 | access to parameter b | ExitMethods.cs:56:19:56:33 | object creation of type Exception |
| pre | ExitMethods.cs:56:19:56:33 | object creation of type Exception | ExitMethods.cs:56:13:56:34 | throw ...; |
| pre | ExitMethods.cs:59:17:59:27 | enter ErrorAlways | ExitMethods.cs:60:5:65:5 | {...} |
| pre | ExitMethods.cs:60:5:65:5 | {...} | ExitMethods.cs:61:9:64:45 | if (...) ... |
| pre | ExitMethods.cs:61:9:64:45 | if (...) ... | ExitMethods.cs:61:13:61:13 | access to parameter b |
| pre | ExitMethods.cs:61:13:61:13 | access to parameter b | ExitMethods.cs:62:19:62:33 | object creation of type Exception |
| pre | ExitMethods.cs:61:13:61:13 | access to parameter b | ExitMethods.cs:64:41:64:43 | "b" |
| pre | ExitMethods.cs:62:19:62:33 | object creation of type Exception | ExitMethods.cs:62:13:62:34 | throw ...; |
| pre | ExitMethods.cs:64:19:64:44 | object creation of type ArgumentException | ExitMethods.cs:64:13:64:45 | throw ...; |
| pre | ExitMethods.cs:64:41:64:43 | "b" | ExitMethods.cs:64:19:64:44 | object creation of type ArgumentException |
| pre | ExitMethods.cs:67:10:67:13 | enter Exit | ExitMethods.cs:68:5:70:5 | {...} |
| pre | ExitMethods.cs:68:5:70:5 | {...} | ExitMethods.cs:69:9:69:28 | ...; |
| pre | ExitMethods.cs:69:9:69:27 | call to method Exit | ExitMethods.cs:67:10:67:13 | exit Exit |
| pre | ExitMethods.cs:69:9:69:28 | ...; | ExitMethods.cs:69:26:69:26 | 0 |
| pre | ExitMethods.cs:69:26:69:26 | 0 | ExitMethods.cs:69:9:69:27 | call to method Exit |
| pre | ExitMethods.cs:72:10:72:18 | enter ExitInTry | ExitMethods.cs:73:5:83:5 | {...} |
| pre | ExitMethods.cs:73:5:83:5 | {...} | ExitMethods.cs:74:9:82:9 | try {...} ... |
| pre | ExitMethods.cs:74:9:82:9 | try {...} ... | ExitMethods.cs:75:9:77:9 | {...} |
| pre | ExitMethods.cs:75:9:77:9 | {...} | ExitMethods.cs:76:13:76:19 | ...; |
| pre | ExitMethods.cs:76:13:76:18 | call to method Exit | ExitMethods.cs:72:10:72:18 | exit ExitInTry |
| pre | ExitMethods.cs:76:13:76:18 | this access | ExitMethods.cs:76:13:76:18 | call to method Exit |
| pre | ExitMethods.cs:76:13:76:19 | ...; | ExitMethods.cs:76:13:76:18 | this access |
| pre | ExitMethods.cs:85:10:85:24 | enter ApplicationExit | ExitMethods.cs:86:5:88:5 | {...} |
| pre | ExitMethods.cs:86:5:88:5 | {...} | ExitMethods.cs:87:9:87:48 | ...; |
| pre | ExitMethods.cs:87:9:87:47 | call to method Exit | ExitMethods.cs:85:10:85:24 | exit ApplicationExit |
| pre | ExitMethods.cs:87:9:87:48 | ...; | ExitMethods.cs:87:9:87:47 | call to method Exit |
| pre | ExitMethods.cs:90:13:90:21 | enter ThrowExpr | ExitMethods.cs:91:5:93:5 | {...} |
| pre | ExitMethods.cs:91:5:93:5 | {...} | ExitMethods.cs:92:16:92:76 | ... ? ... : ... |
| pre | ExitMethods.cs:92:16:92:20 | access to parameter input | ExitMethods.cs:92:25:92:25 | 0 |
| pre | ExitMethods.cs:92:16:92:25 | ... != ... | ExitMethods.cs:92:29:92:29 | 1 |
| pre | ExitMethods.cs:92:16:92:25 | ... != ... | ExitMethods.cs:92:69:92:75 | "input" |
| pre | ExitMethods.cs:92:16:92:76 | ... ? ... : ... | ExitMethods.cs:92:16:92:20 | access to parameter input |
| pre | ExitMethods.cs:92:25:92:25 | 0 | ExitMethods.cs:92:25:92:25 | (...) ... |
| pre | ExitMethods.cs:92:25:92:25 | (...) ... | ExitMethods.cs:92:16:92:25 | ... != ... |
| pre | ExitMethods.cs:92:29:92:29 | 1 | ExitMethods.cs:92:29:92:29 | (...) ... |
| pre | ExitMethods.cs:92:29:92:29 | (...) ... | ExitMethods.cs:92:33:92:37 | access to parameter input |
| pre | ExitMethods.cs:92:29:92:37 | ... / ... | ExitMethods.cs:92:9:92:77 | return ...; |
| pre | ExitMethods.cs:92:33:92:37 | access to parameter input | ExitMethods.cs:92:29:92:37 | ... / ... |
| pre | ExitMethods.cs:92:47:92:76 | object creation of type ArgumentException | ExitMethods.cs:92:41:92:76 | throw ... |
| pre | ExitMethods.cs:92:69:92:75 | "input" | ExitMethods.cs:92:47:92:76 | object creation of type ArgumentException |
| pre | ExitMethods.cs:95:16:95:34 | enter ExtensionMethodCall | ExitMethods.cs:96:5:98:5 | {...} |
| pre | ExitMethods.cs:96:5:98:5 | {...} | ExitMethods.cs:97:16:97:38 | ... ? ... : ... |
| pre | ExitMethods.cs:97:9:97:39 | return ...; | ExitMethods.cs:95:16:95:34 | exit ExtensionMethodCall |
| pre | ExitMethods.cs:97:16:97:16 | access to parameter s | ExitMethods.cs:97:27:97:29 | - |
| pre | ExitMethods.cs:97:16:97:30 | call to method Contains | ExitMethods.cs:97:34:97:34 | 0 |
| pre | ExitMethods.cs:97:16:97:30 | call to method Contains | ExitMethods.cs:97:38:97:38 | 1 |
| pre | ExitMethods.cs:97:16:97:38 | ... ? ... : ... | ExitMethods.cs:97:16:97:16 | access to parameter s |
| pre | ExitMethods.cs:97:27:97:29 | - | ExitMethods.cs:97:16:97:30 | call to method Contains |
| pre | ExitMethods.cs:100:17:100:32 | enter FailingAssertion | ExitMethods.cs:101:5:104:5 | {...} |
| pre | ExitMethods.cs:101:5:104:5 | {...} | ExitMethods.cs:102:9:102:29 | ...; |
| pre | ExitMethods.cs:102:9:102:28 | call to method IsTrue | ExitMethods.cs:100:17:100:32 | exit FailingAssertion |
| pre | ExitMethods.cs:102:9:102:29 | ...; | ExitMethods.cs:102:23:102:27 | false |
| pre | ExitMethods.cs:102:23:102:27 | false | ExitMethods.cs:102:9:102:28 | call to method IsTrue |
| pre | ExitMethods.cs:106:17:106:33 | enter FailingAssertion2 | ExitMethods.cs:107:5:110:5 | {...} |
| pre | ExitMethods.cs:107:5:110:5 | {...} | ExitMethods.cs:108:9:108:27 | ...; |
| pre | ExitMethods.cs:108:9:108:26 | call to method FailingAssertion | ExitMethods.cs:106:17:106:33 | exit FailingAssertion2 |
| pre | ExitMethods.cs:108:9:108:26 | this access | ExitMethods.cs:108:9:108:26 | call to method FailingAssertion |
| pre | ExitMethods.cs:108:9:108:27 | ...; | ExitMethods.cs:108:9:108:26 | this access |
| pre | ExitMethods.cs:112:10:112:20 | enter AssertFalse | ExitMethods.cs:112:48:112:48 | access to parameter b |
| pre | ExitMethods.cs:112:33:112:49 | call to method IsFalse | ExitMethods.cs:112:10:112:20 | exit AssertFalse |
| pre | ExitMethods.cs:112:48:112:48 | access to parameter b | ExitMethods.cs:112:33:112:49 | call to method IsFalse |
| pre | ExitMethods.cs:114:17:114:33 | enter FailingAssertion3 | ExitMethods.cs:115:5:118:5 | {...} |
| pre | ExitMethods.cs:115:5:118:5 | {...} | ExitMethods.cs:116:9:116:26 | ...; |
| pre | ExitMethods.cs:116:9:116:25 | call to method AssertFalse | ExitMethods.cs:114:17:114:33 | exit FailingAssertion3 |
| pre | ExitMethods.cs:116:9:116:25 | this access | ExitMethods.cs:116:21:116:24 | true |
| pre | ExitMethods.cs:116:9:116:26 | ...; | ExitMethods.cs:116:9:116:25 | this access |
| pre | ExitMethods.cs:116:21:116:24 | true | ExitMethods.cs:116:9:116:25 | call to method AssertFalse |
| pre | Extensions.cs:5:23:5:29 | enter ToInt32 | Extensions.cs:6:5:8:5 | {...} |
| pre | Extensions.cs:6:5:8:5 | {...} | Extensions.cs:7:28:7:28 | access to parameter s |
| pre | Extensions.cs:7:9:7:30 | return ...; | Extensions.cs:5:23:5:29 | exit ToInt32 |

View File

@@ -1,6 +1,7 @@
import csharp
import Common
from ControlFlow::Node dom, ControlFlow::Node node, string s
from SourceControlFlowNode dom, SourceControlFlowNode node, string s
where
dom.strictlyDominates(node) and dom.getASuccessor() = node and s = "pre"
or

View File

@@ -474,72 +474,88 @@
| Conditions.cs:109:17:109:24 | ...; | Conditions.cs:109:17:109:17 | access to local variable x | semmle.label | successor |
| Conditions.cs:109:22:109:23 | "" | Conditions.cs:109:17:109:23 | ... + ... | semmle.label | successor |
| Conditions.cs:110:16:110:16 | access to local variable x | Conditions.cs:110:9:110:17 | return ...; | semmle.label | successor |
| ExitMethods.cs:7:5:10:5 | {...} | ExitMethods.cs:8:9:8:25 | ...; | semmle.label | successor |
| ExitMethods.cs:8:9:8:24 | call to method ErrorMaybe | ExitMethods.cs:9:9:9:15 | return ...; | semmle.label | successor |
| ExitMethods.cs:8:9:8:25 | ...; | ExitMethods.cs:8:20:8:23 | true | semmle.label | successor |
| ExitMethods.cs:8:20:8:23 | true | ExitMethods.cs:8:9:8:24 | call to method ErrorMaybe | semmle.label | successor |
| ExitMethods.cs:13:5:16:5 | {...} | ExitMethods.cs:14:9:14:26 | ...; | semmle.label | successor |
| ExitMethods.cs:14:9:14:25 | call to method ErrorMaybe | ExitMethods.cs:15:9:15:15 | return ...; | semmle.label | successor |
| ExitMethods.cs:14:9:14:26 | ...; | ExitMethods.cs:14:20:14:24 | false | semmle.label | successor |
| ExitMethods.cs:14:20:14:24 | false | ExitMethods.cs:14:9:14:25 | call to method ErrorMaybe | semmle.label | successor |
| ExitMethods.cs:19:5:22:5 | {...} | ExitMethods.cs:20:9:20:26 | ...; | semmle.label | successor |
| ExitMethods.cs:20:9:20:26 | ...; | ExitMethods.cs:20:21:20:24 | true | semmle.label | successor |
| ExitMethods.cs:20:21:20:24 | true | ExitMethods.cs:20:9:20:25 | call to method ErrorAlways | semmle.label | successor |
| ExitMethods.cs:25:5:28:5 | {...} | ExitMethods.cs:26:9:26:15 | ...; | semmle.label | successor |
| ExitMethods.cs:26:9:26:14 | this access | ExitMethods.cs:26:9:26:14 | call to method Exit | semmle.label | successor |
| ExitMethods.cs:26:9:26:15 | ...; | ExitMethods.cs:26:9:26:14 | this access | semmle.label | successor |
| ExitMethods.cs:31:5:34:5 | {...} | ExitMethods.cs:32:9:32:26 | ...; | semmle.label | successor |
| ExitMethods.cs:32:9:32:25 | this access | ExitMethods.cs:32:9:32:25 | call to method ApplicationExit | semmle.label | successor |
| ExitMethods.cs:32:9:32:26 | ...; | ExitMethods.cs:32:9:32:25 | this access | semmle.label | successor |
| ExitMethods.cs:37:5:50:5 | {...} | ExitMethods.cs:38:9:49:9 | try {...} ... | semmle.label | successor |
| ExitMethods.cs:38:9:49:9 | try {...} ... | ExitMethods.cs:39:9:41:9 | {...} | semmle.label | successor |
| ExitMethods.cs:39:9:41:9 | {...} | ExitMethods.cs:40:13:40:31 | ...; | semmle.label | successor |
| ExitMethods.cs:40:13:40:30 | call to method ErrorAlways | ExitMethods.cs:42:9:45:9 | catch (...) {...} | semmle.label | exception(ArgumentException) |
| ExitMethods.cs:40:13:40:30 | call to method ErrorAlways | ExitMethods.cs:42:9:45:9 | catch (...) {...} | semmle.label | exception(Exception) |
| ExitMethods.cs:40:13:40:31 | ...; | ExitMethods.cs:40:25:40:29 | false | semmle.label | successor |
| ExitMethods.cs:40:25:40:29 | false | ExitMethods.cs:40:13:40:30 | call to method ErrorAlways | semmle.label | successor |
| ExitMethods.cs:42:9:45:9 | catch (...) {...} | ExitMethods.cs:43:9:45:9 | {...} | semmle.label | match |
| ExitMethods.cs:42:9:45:9 | catch (...) {...} | ExitMethods.cs:46:9:49:9 | catch (...) {...} | semmle.label | no-match |
| ExitMethods.cs:43:9:45:9 | {...} | ExitMethods.cs:44:13:44:19 | return ...; | semmle.label | successor |
| ExitMethods.cs:46:9:49:9 | catch (...) {...} | ExitMethods.cs:47:9:49:9 | {...} | semmle.label | match |
| ExitMethods.cs:47:9:49:9 | {...} | ExitMethods.cs:48:13:48:19 | return ...; | semmle.label | successor |
| ExitMethods.cs:53:5:56:5 | {...} | ExitMethods.cs:54:9:55:34 | if (...) ... | semmle.label | successor |
| ExitMethods.cs:54:9:55:34 | if (...) ... | ExitMethods.cs:54:13:54:13 | access to parameter b | semmle.label | successor |
| ExitMethods.cs:54:13:54:13 | access to parameter b | ExitMethods.cs:55:19:55:33 | object creation of type Exception | semmle.label | true |
| ExitMethods.cs:55:19:55:33 | object creation of type Exception | ExitMethods.cs:55:13:55:34 | throw ...; | semmle.label | successor |
| ExitMethods.cs:59:5:64:5 | {...} | ExitMethods.cs:60:9:63:45 | if (...) ... | semmle.label | successor |
| ExitMethods.cs:60:9:63:45 | if (...) ... | ExitMethods.cs:60:13:60:13 | access to parameter b | semmle.label | successor |
| ExitMethods.cs:60:13:60:13 | access to parameter b | ExitMethods.cs:61:19:61:33 | object creation of type Exception | semmle.label | true |
| ExitMethods.cs:60:13:60:13 | access to parameter b | ExitMethods.cs:63:41:63:43 | "b" | semmle.label | false |
| ExitMethods.cs:61:19:61:33 | object creation of type Exception | ExitMethods.cs:61:13:61:34 | throw ...; | semmle.label | successor |
| ExitMethods.cs:63:19:63:44 | object creation of type ArgumentException | ExitMethods.cs:63:13:63:45 | throw ...; | semmle.label | successor |
| ExitMethods.cs:63:41:63:43 | "b" | ExitMethods.cs:63:19:63:44 | object creation of type ArgumentException | semmle.label | successor |
| ExitMethods.cs:67:5:69:5 | {...} | ExitMethods.cs:68:9:68:28 | ...; | semmle.label | successor |
| ExitMethods.cs:68:9:68:28 | ...; | ExitMethods.cs:68:26:68:26 | 0 | semmle.label | successor |
| ExitMethods.cs:68:26:68:26 | 0 | ExitMethods.cs:68:9:68:27 | call to method Exit | semmle.label | successor |
| ExitMethods.cs:72:5:74:5 | {...} | ExitMethods.cs:73:9:73:48 | ...; | semmle.label | successor |
| ExitMethods.cs:73:9:73:48 | ...; | ExitMethods.cs:73:9:73:47 | call to method Exit | semmle.label | successor |
| ExitMethods.cs:77:5:79:5 | {...} | ExitMethods.cs:78:16:78:76 | ... ? ... : ... | semmle.label | successor |
| ExitMethods.cs:78:16:78:20 | access to parameter input | ExitMethods.cs:78:25:78:25 | 0 | semmle.label | successor |
| ExitMethods.cs:78:16:78:25 | ... != ... | ExitMethods.cs:78:29:78:29 | 1 | semmle.label | true |
| ExitMethods.cs:78:16:78:25 | ... != ... | ExitMethods.cs:78:69:78:75 | "input" | semmle.label | false |
| ExitMethods.cs:78:16:78:76 | ... ? ... : ... | ExitMethods.cs:78:16:78:20 | access to parameter input | semmle.label | successor |
| ExitMethods.cs:78:25:78:25 | 0 | ExitMethods.cs:78:25:78:25 | (...) ... | semmle.label | successor |
| ExitMethods.cs:78:25:78:25 | (...) ... | ExitMethods.cs:78:16:78:25 | ... != ... | semmle.label | successor |
| ExitMethods.cs:78:29:78:29 | 1 | ExitMethods.cs:78:29:78:29 | (...) ... | semmle.label | successor |
| ExitMethods.cs:78:29:78:29 | (...) ... | ExitMethods.cs:78:33:78:37 | access to parameter input | semmle.label | successor |
| ExitMethods.cs:78:29:78:37 | ... / ... | ExitMethods.cs:78:9:78:77 | return ...; | semmle.label | successor |
| ExitMethods.cs:78:33:78:37 | access to parameter input | ExitMethods.cs:78:29:78:37 | ... / ... | semmle.label | successor |
| ExitMethods.cs:78:47:78:76 | object creation of type ArgumentException | ExitMethods.cs:78:41:78:76 | throw ... | semmle.label | successor |
| ExitMethods.cs:78:69:78:75 | "input" | ExitMethods.cs:78:47:78:76 | object creation of type ArgumentException | semmle.label | successor |
| ExitMethods.cs:82:5:84:5 | {...} | ExitMethods.cs:83:16:83:38 | ... ? ... : ... | semmle.label | successor |
| ExitMethods.cs:83:16:83:16 | access to parameter s | ExitMethods.cs:83:27:83:29 | - | semmle.label | successor |
| ExitMethods.cs:83:16:83:30 | call to method Contains | ExitMethods.cs:83:34:83:34 | 0 | semmle.label | true |
| ExitMethods.cs:83:16:83:30 | call to method Contains | ExitMethods.cs:83:38:83:38 | 1 | semmle.label | false |
| ExitMethods.cs:83:16:83:38 | ... ? ... : ... | ExitMethods.cs:83:16:83:16 | access to parameter s | semmle.label | successor |
| ExitMethods.cs:83:27:83:29 | - | ExitMethods.cs:83:16:83:30 | call to method Contains | semmle.label | successor |
| ExitMethods.cs:83:34:83:34 | 0 | ExitMethods.cs:83:9:83:39 | return ...; | semmle.label | successor |
| ExitMethods.cs:83:38:83:38 | 1 | ExitMethods.cs:83:9:83:39 | return ...; | semmle.label | successor |
| ExitMethods.cs:8:5:11:5 | {...} | ExitMethods.cs:9:9:9:25 | ...; | semmle.label | successor |
| ExitMethods.cs:9:9:9:24 | call to method ErrorMaybe | ExitMethods.cs:10:9:10:15 | return ...; | semmle.label | successor |
| ExitMethods.cs:9:9:9:25 | ...; | ExitMethods.cs:9:20:9:23 | true | semmle.label | successor |
| ExitMethods.cs:9:20:9:23 | true | ExitMethods.cs:9:9:9:24 | call to method ErrorMaybe | semmle.label | successor |
| ExitMethods.cs:14:5:17:5 | {...} | ExitMethods.cs:15:9:15:26 | ...; | semmle.label | successor |
| ExitMethods.cs:15:9:15:25 | call to method ErrorMaybe | ExitMethods.cs:16:9:16:15 | return ...; | semmle.label | successor |
| ExitMethods.cs:15:9:15:26 | ...; | ExitMethods.cs:15:20:15:24 | false | semmle.label | successor |
| ExitMethods.cs:15:20:15:24 | false | ExitMethods.cs:15:9:15:25 | call to method ErrorMaybe | semmle.label | successor |
| ExitMethods.cs:20:5:23:5 | {...} | ExitMethods.cs:21:9:21:26 | ...; | semmle.label | successor |
| ExitMethods.cs:21:9:21:26 | ...; | ExitMethods.cs:21:21:21:24 | true | semmle.label | successor |
| ExitMethods.cs:21:21:21:24 | true | ExitMethods.cs:21:9:21:25 | call to method ErrorAlways | semmle.label | successor |
| ExitMethods.cs:26:5:29:5 | {...} | ExitMethods.cs:27:9:27:15 | ...; | semmle.label | successor |
| ExitMethods.cs:27:9:27:14 | this access | ExitMethods.cs:27:9:27:14 | call to method Exit | semmle.label | successor |
| ExitMethods.cs:27:9:27:15 | ...; | ExitMethods.cs:27:9:27:14 | this access | semmle.label | successor |
| ExitMethods.cs:32:5:35:5 | {...} | ExitMethods.cs:33:9:33:26 | ...; | semmle.label | successor |
| ExitMethods.cs:33:9:33:25 | this access | ExitMethods.cs:33:9:33:25 | call to method ApplicationExit | semmle.label | successor |
| ExitMethods.cs:33:9:33:26 | ...; | ExitMethods.cs:33:9:33:25 | this access | semmle.label | successor |
| ExitMethods.cs:38:5:51:5 | {...} | ExitMethods.cs:39:9:50:9 | try {...} ... | semmle.label | successor |
| ExitMethods.cs:39:9:50:9 | try {...} ... | ExitMethods.cs:40:9:42:9 | {...} | semmle.label | successor |
| ExitMethods.cs:40:9:42:9 | {...} | ExitMethods.cs:41:13:41:31 | ...; | semmle.label | successor |
| ExitMethods.cs:41:13:41:30 | call to method ErrorAlways | ExitMethods.cs:43:9:46:9 | catch (...) {...} | semmle.label | exception(ArgumentException) |
| ExitMethods.cs:41:13:41:30 | call to method ErrorAlways | ExitMethods.cs:43:9:46:9 | catch (...) {...} | semmle.label | exception(Exception) |
| ExitMethods.cs:41:13:41:31 | ...; | ExitMethods.cs:41:25:41:29 | false | semmle.label | successor |
| ExitMethods.cs:41:25:41:29 | false | ExitMethods.cs:41:13:41:30 | call to method ErrorAlways | semmle.label | successor |
| ExitMethods.cs:43:9:46:9 | catch (...) {...} | ExitMethods.cs:44:9:46:9 | {...} | semmle.label | match |
| ExitMethods.cs:43:9:46:9 | catch (...) {...} | ExitMethods.cs:47:9:50:9 | catch (...) {...} | semmle.label | no-match |
| ExitMethods.cs:44:9:46:9 | {...} | ExitMethods.cs:45:13:45:19 | return ...; | semmle.label | successor |
| ExitMethods.cs:47:9:50:9 | catch (...) {...} | ExitMethods.cs:48:9:50:9 | {...} | semmle.label | match |
| ExitMethods.cs:48:9:50:9 | {...} | ExitMethods.cs:49:13:49:19 | return ...; | semmle.label | successor |
| ExitMethods.cs:54:5:57:5 | {...} | ExitMethods.cs:55:9:56:34 | if (...) ... | semmle.label | successor |
| ExitMethods.cs:55:9:56:34 | if (...) ... | ExitMethods.cs:55:13:55:13 | access to parameter b | semmle.label | successor |
| ExitMethods.cs:55:13:55:13 | access to parameter b | ExitMethods.cs:56:19:56:33 | object creation of type Exception | semmle.label | true |
| ExitMethods.cs:56:19:56:33 | object creation of type Exception | ExitMethods.cs:56:13:56:34 | throw ...; | semmle.label | successor |
| ExitMethods.cs:60:5:65:5 | {...} | ExitMethods.cs:61:9:64:45 | if (...) ... | semmle.label | successor |
| ExitMethods.cs:61:9:64:45 | if (...) ... | ExitMethods.cs:61:13:61:13 | access to parameter b | semmle.label | successor |
| ExitMethods.cs:61:13:61:13 | access to parameter b | ExitMethods.cs:62:19:62:33 | object creation of type Exception | semmle.label | true |
| ExitMethods.cs:61:13:61:13 | access to parameter b | ExitMethods.cs:64:41:64:43 | "b" | semmle.label | false |
| ExitMethods.cs:62:19:62:33 | object creation of type Exception | ExitMethods.cs:62:13:62:34 | throw ...; | semmle.label | successor |
| ExitMethods.cs:64:19:64:44 | object creation of type ArgumentException | ExitMethods.cs:64:13:64:45 | throw ...; | semmle.label | successor |
| ExitMethods.cs:64:41:64:43 | "b" | ExitMethods.cs:64:19:64:44 | object creation of type ArgumentException | semmle.label | successor |
| ExitMethods.cs:68:5:70:5 | {...} | ExitMethods.cs:69:9:69:28 | ...; | semmle.label | successor |
| ExitMethods.cs:69:9:69:28 | ...; | ExitMethods.cs:69:26:69:26 | 0 | semmle.label | successor |
| ExitMethods.cs:69:26:69:26 | 0 | ExitMethods.cs:69:9:69:27 | call to method Exit | semmle.label | successor |
| ExitMethods.cs:73:5:83:5 | {...} | ExitMethods.cs:74:9:82:9 | try {...} ... | semmle.label | successor |
| ExitMethods.cs:74:9:82:9 | try {...} ... | ExitMethods.cs:75:9:77:9 | {...} | semmle.label | successor |
| ExitMethods.cs:75:9:77:9 | {...} | ExitMethods.cs:76:13:76:19 | ...; | semmle.label | successor |
| ExitMethods.cs:76:13:76:18 | this access | ExitMethods.cs:76:13:76:18 | call to method Exit | semmle.label | successor |
| ExitMethods.cs:76:13:76:19 | ...; | ExitMethods.cs:76:13:76:18 | this access | semmle.label | successor |
| ExitMethods.cs:86:5:88:5 | {...} | ExitMethods.cs:87:9:87:48 | ...; | semmle.label | successor |
| ExitMethods.cs:87:9:87:48 | ...; | ExitMethods.cs:87:9:87:47 | call to method Exit | semmle.label | successor |
| ExitMethods.cs:91:5:93:5 | {...} | ExitMethods.cs:92:16:92:76 | ... ? ... : ... | semmle.label | successor |
| ExitMethods.cs:92:16:92:20 | access to parameter input | ExitMethods.cs:92:25:92:25 | 0 | semmle.label | successor |
| ExitMethods.cs:92:16:92:25 | ... != ... | ExitMethods.cs:92:29:92:29 | 1 | semmle.label | true |
| ExitMethods.cs:92:16:92:25 | ... != ... | ExitMethods.cs:92:69:92:75 | "input" | semmle.label | false |
| ExitMethods.cs:92:16:92:76 | ... ? ... : ... | ExitMethods.cs:92:16:92:20 | access to parameter input | semmle.label | successor |
| ExitMethods.cs:92:25:92:25 | 0 | ExitMethods.cs:92:25:92:25 | (...) ... | semmle.label | successor |
| ExitMethods.cs:92:25:92:25 | (...) ... | ExitMethods.cs:92:16:92:25 | ... != ... | semmle.label | successor |
| ExitMethods.cs:92:29:92:29 | 1 | ExitMethods.cs:92:29:92:29 | (...) ... | semmle.label | successor |
| ExitMethods.cs:92:29:92:29 | (...) ... | ExitMethods.cs:92:33:92:37 | access to parameter input | semmle.label | successor |
| ExitMethods.cs:92:29:92:37 | ... / ... | ExitMethods.cs:92:9:92:77 | return ...; | semmle.label | successor |
| ExitMethods.cs:92:33:92:37 | access to parameter input | ExitMethods.cs:92:29:92:37 | ... / ... | semmle.label | successor |
| ExitMethods.cs:92:47:92:76 | object creation of type ArgumentException | ExitMethods.cs:92:41:92:76 | throw ... | semmle.label | successor |
| ExitMethods.cs:92:69:92:75 | "input" | ExitMethods.cs:92:47:92:76 | object creation of type ArgumentException | semmle.label | successor |
| ExitMethods.cs:96:5:98:5 | {...} | ExitMethods.cs:97:16:97:38 | ... ? ... : ... | semmle.label | successor |
| ExitMethods.cs:97:16:97:16 | access to parameter s | ExitMethods.cs:97:27:97:29 | - | semmle.label | successor |
| ExitMethods.cs:97:16:97:30 | call to method Contains | ExitMethods.cs:97:34:97:34 | 0 | semmle.label | true |
| ExitMethods.cs:97:16:97:30 | call to method Contains | ExitMethods.cs:97:38:97:38 | 1 | semmle.label | false |
| ExitMethods.cs:97:16:97:38 | ... ? ... : ... | ExitMethods.cs:97:16:97:16 | access to parameter s | semmle.label | successor |
| ExitMethods.cs:97:27:97:29 | - | ExitMethods.cs:97:16:97:30 | call to method Contains | semmle.label | successor |
| ExitMethods.cs:97:34:97:34 | 0 | ExitMethods.cs:97:9:97:39 | return ...; | semmle.label | successor |
| ExitMethods.cs:97:38:97:38 | 1 | ExitMethods.cs:97:9:97:39 | return ...; | semmle.label | successor |
| ExitMethods.cs:101:5:104:5 | {...} | ExitMethods.cs:102:9:102:29 | ...; | semmle.label | successor |
| ExitMethods.cs:102:9:102:29 | ...; | ExitMethods.cs:102:23:102:27 | false | semmle.label | successor |
| ExitMethods.cs:102:23:102:27 | false | ExitMethods.cs:102:9:102:28 | call to method IsTrue | semmle.label | successor |
| ExitMethods.cs:107:5:110:5 | {...} | ExitMethods.cs:108:9:108:27 | ...; | semmle.label | successor |
| ExitMethods.cs:108:9:108:26 | this access | ExitMethods.cs:108:9:108:26 | call to method FailingAssertion | semmle.label | successor |
| ExitMethods.cs:108:9:108:27 | ...; | ExitMethods.cs:108:9:108:26 | this access | semmle.label | successor |
| ExitMethods.cs:112:48:112:48 | access to parameter b | ExitMethods.cs:112:33:112:49 | call to method IsFalse | semmle.label | successor |
| ExitMethods.cs:115:5:118:5 | {...} | ExitMethods.cs:116:9:116:26 | ...; | semmle.label | successor |
| ExitMethods.cs:116:9:116:25 | this access | ExitMethods.cs:116:21:116:24 | true | semmle.label | successor |
| ExitMethods.cs:116:9:116:26 | ...; | ExitMethods.cs:116:9:116:25 | this access | semmle.label | successor |
| ExitMethods.cs:116:21:116:24 | true | ExitMethods.cs:116:9:116:25 | call to method AssertFalse | semmle.label | successor |
| Extensions.cs:6:5:8:5 | {...} | Extensions.cs:7:28:7:28 | access to parameter s | semmle.label | successor |
| Extensions.cs:7:16:7:29 | call to method Parse | Extensions.cs:7:9:7:30 | return ...; | semmle.label | successor |
| Extensions.cs:7:28:7:28 | access to parameter s | Extensions.cs:7:16:7:29 | call to method Parse | semmle.label | successor |

View File

@@ -1,6 +1,7 @@
import csharp
import Common
query predicate edges(ControlFlowElement node, ControlFlowElement successor, string attr, string val) {
query predicate edges(SourceControlFlowElement node, SourceControlFlowElement successor, string attr, string val) {
exists(ControlFlow::SuccessorType t |
successor = node.getAControlFlowNode().getASuccessorByType(t).getElement() |
attr = "semmle.label" and

View File

@@ -478,86 +478,122 @@
| Conditions.cs:109:22:109:23 | "" | Conditions.cs:109:22:109:23 | "" |
| Conditions.cs:110:9:110:17 | return ...; | Conditions.cs:110:16:110:16 | access to local variable x |
| Conditions.cs:110:16:110:16 | access to local variable x | Conditions.cs:110:16:110:16 | access to local variable x |
| ExitMethods.cs:7:5:10:5 | {...} | ExitMethods.cs:7:5:10:5 | {...} |
| ExitMethods.cs:8:9:8:24 | call to method ErrorMaybe | ExitMethods.cs:8:20:8:23 | true |
| ExitMethods.cs:8:9:8:25 | ...; | ExitMethods.cs:8:9:8:25 | ...; |
| ExitMethods.cs:8:20:8:23 | true | ExitMethods.cs:8:20:8:23 | true |
| ExitMethods.cs:9:9:9:15 | return ...; | ExitMethods.cs:9:9:9:15 | return ...; |
| ExitMethods.cs:13:5:16:5 | {...} | ExitMethods.cs:13:5:16:5 | {...} |
| ExitMethods.cs:14:9:14:25 | call to method ErrorMaybe | ExitMethods.cs:14:20:14:24 | false |
| ExitMethods.cs:14:9:14:26 | ...; | ExitMethods.cs:14:9:14:26 | ...; |
| ExitMethods.cs:14:20:14:24 | false | ExitMethods.cs:14:20:14:24 | false |
| ExitMethods.cs:15:9:15:15 | return ...; | ExitMethods.cs:15:9:15:15 | return ...; |
| ExitMethods.cs:19:5:22:5 | {...} | ExitMethods.cs:19:5:22:5 | {...} |
| ExitMethods.cs:20:9:20:25 | call to method ErrorAlways | ExitMethods.cs:20:21:20:24 | true |
| ExitMethods.cs:20:9:20:26 | ...; | ExitMethods.cs:20:9:20:26 | ...; |
| ExitMethods.cs:20:21:20:24 | true | ExitMethods.cs:20:21:20:24 | true |
| ExitMethods.cs:21:9:21:15 | return ...; | ExitMethods.cs:21:9:21:15 | return ...; |
| ExitMethods.cs:25:5:28:5 | {...} | ExitMethods.cs:25:5:28:5 | {...} |
| ExitMethods.cs:26:9:26:14 | call to method Exit | ExitMethods.cs:26:9:26:14 | this access |
| ExitMethods.cs:26:9:26:14 | this access | ExitMethods.cs:26:9:26:14 | this access |
| ExitMethods.cs:26:9:26:15 | ...; | ExitMethods.cs:26:9:26:15 | ...; |
| ExitMethods.cs:27:9:27:15 | return ...; | ExitMethods.cs:27:9:27:15 | return ...; |
| ExitMethods.cs:31:5:34:5 | {...} | ExitMethods.cs:31:5:34:5 | {...} |
| ExitMethods.cs:32:9:32:25 | call to method ApplicationExit | ExitMethods.cs:32:9:32:25 | this access |
| ExitMethods.cs:32:9:32:25 | this access | ExitMethods.cs:32:9:32:25 | this access |
| ExitMethods.cs:32:9:32:26 | ...; | ExitMethods.cs:32:9:32:26 | ...; |
| ExitMethods.cs:33:9:33:15 | return ...; | ExitMethods.cs:33:9:33:15 | return ...; |
| ExitMethods.cs:37:5:50:5 | {...} | ExitMethods.cs:37:5:50:5 | {...} |
| ExitMethods.cs:38:9:49:9 | try {...} ... | ExitMethods.cs:38:9:49:9 | try {...} ... |
| ExitMethods.cs:39:9:41:9 | {...} | ExitMethods.cs:39:9:41:9 | {...} |
| ExitMethods.cs:40:13:40:30 | call to method ErrorAlways | ExitMethods.cs:40:25:40:29 | false |
| ExitMethods.cs:40:13:40:31 | ...; | ExitMethods.cs:40:13:40:31 | ...; |
| ExitMethods.cs:40:25:40:29 | false | ExitMethods.cs:40:25:40:29 | false |
| ExitMethods.cs:42:9:45:9 | catch (...) {...} | ExitMethods.cs:42:9:45:9 | catch (...) {...} |
| ExitMethods.cs:43:9:45:9 | {...} | ExitMethods.cs:43:9:45:9 | {...} |
| ExitMethods.cs:44:13:44:19 | return ...; | ExitMethods.cs:44:13:44:19 | return ...; |
| ExitMethods.cs:46:9:49:9 | catch (...) {...} | ExitMethods.cs:46:9:49:9 | catch (...) {...} |
| ExitMethods.cs:47:9:49:9 | {...} | ExitMethods.cs:47:9:49:9 | {...} |
| ExitMethods.cs:48:13:48:19 | return ...; | ExitMethods.cs:48:13:48:19 | return ...; |
| ExitMethods.cs:53:5:56:5 | {...} | ExitMethods.cs:53:5:56:5 | {...} |
| ExitMethods.cs:54:9:55:34 | if (...) ... | ExitMethods.cs:54:9:55:34 | if (...) ... |
| ExitMethods.cs:54:13:54:13 | access to parameter b | ExitMethods.cs:54:13:54:13 | access to parameter b |
| ExitMethods.cs:55:13:55:34 | throw ...; | ExitMethods.cs:55:19:55:33 | object creation of type Exception |
| ExitMethods.cs:55:19:55:33 | object creation of type Exception | ExitMethods.cs:55:19:55:33 | object creation of type Exception |
| ExitMethods.cs:59:5:64:5 | {...} | ExitMethods.cs:59:5:64:5 | {...} |
| ExitMethods.cs:60:9:63:45 | if (...) ... | ExitMethods.cs:60:9:63:45 | if (...) ... |
| ExitMethods.cs:60:13:60:13 | access to parameter b | ExitMethods.cs:60:13:60:13 | access to parameter b |
| ExitMethods.cs:61:13:61:34 | throw ...; | ExitMethods.cs:61:19:61:33 | object creation of type Exception |
| ExitMethods.cs:61:19:61:33 | object creation of type Exception | ExitMethods.cs:61:19:61:33 | object creation of type Exception |
| ExitMethods.cs:63:13:63:45 | throw ...; | ExitMethods.cs:63:41:63:43 | "b" |
| ExitMethods.cs:63:19:63:44 | object creation of type ArgumentException | ExitMethods.cs:63:41:63:43 | "b" |
| ExitMethods.cs:63:41:63:43 | "b" | ExitMethods.cs:63:41:63:43 | "b" |
| ExitMethods.cs:67:5:69:5 | {...} | ExitMethods.cs:67:5:69:5 | {...} |
| ExitMethods.cs:68:9:68:27 | call to method Exit | ExitMethods.cs:68:26:68:26 | 0 |
| ExitMethods.cs:68:9:68:28 | ...; | ExitMethods.cs:68:9:68:28 | ...; |
| ExitMethods.cs:68:26:68:26 | 0 | ExitMethods.cs:68:26:68:26 | 0 |
| ExitMethods.cs:72:5:74:5 | {...} | ExitMethods.cs:72:5:74:5 | {...} |
| ExitMethods.cs:73:9:73:47 | call to method Exit | ExitMethods.cs:73:9:73:47 | call to method Exit |
| ExitMethods.cs:73:9:73:48 | ...; | ExitMethods.cs:73:9:73:48 | ...; |
| ExitMethods.cs:77:5:79:5 | {...} | ExitMethods.cs:77:5:79:5 | {...} |
| ExitMethods.cs:78:9:78:77 | return ...; | ExitMethods.cs:78:16:78:76 | ... ? ... : ... |
| ExitMethods.cs:78:16:78:20 | access to parameter input | ExitMethods.cs:78:16:78:20 | access to parameter input |
| ExitMethods.cs:78:16:78:25 | ... != ... | ExitMethods.cs:78:16:78:20 | access to parameter input |
| ExitMethods.cs:78:16:78:76 | ... ? ... : ... | ExitMethods.cs:78:16:78:76 | ... ? ... : ... |
| ExitMethods.cs:78:25:78:25 | 0 | ExitMethods.cs:78:25:78:25 | 0 |
| ExitMethods.cs:78:25:78:25 | (...) ... | ExitMethods.cs:78:25:78:25 | 0 |
| ExitMethods.cs:78:29:78:29 | 1 | ExitMethods.cs:78:29:78:29 | 1 |
| ExitMethods.cs:78:29:78:29 | (...) ... | ExitMethods.cs:78:29:78:29 | 1 |
| ExitMethods.cs:78:29:78:37 | ... / ... | ExitMethods.cs:78:29:78:29 | 1 |
| ExitMethods.cs:78:33:78:37 | access to parameter input | ExitMethods.cs:78:33:78:37 | access to parameter input |
| ExitMethods.cs:78:41:78:76 | throw ... | ExitMethods.cs:78:69:78:75 | "input" |
| ExitMethods.cs:78:47:78:76 | object creation of type ArgumentException | ExitMethods.cs:78:69:78:75 | "input" |
| ExitMethods.cs:78:69:78:75 | "input" | ExitMethods.cs:78:69:78:75 | "input" |
| ExitMethods.cs:82:5:84:5 | {...} | ExitMethods.cs:82:5:84:5 | {...} |
| ExitMethods.cs:83:9:83:39 | return ...; | ExitMethods.cs:83:16:83:38 | ... ? ... : ... |
| ExitMethods.cs:83:16:83:16 | access to parameter s | ExitMethods.cs:83:16:83:16 | access to parameter s |
| ExitMethods.cs:83:16:83:30 | call to method Contains | ExitMethods.cs:83:16:83:16 | access to parameter s |
| ExitMethods.cs:83:16:83:38 | ... ? ... : ... | ExitMethods.cs:83:16:83:38 | ... ? ... : ... |
| ExitMethods.cs:83:27:83:29 | - | ExitMethods.cs:83:27:83:29 | - |
| ExitMethods.cs:83:34:83:34 | 0 | ExitMethods.cs:83:34:83:34 | 0 |
| ExitMethods.cs:83:38:83:38 | 1 | ExitMethods.cs:83:38:83:38 | 1 |
| ExitMethods.cs:91:35:91:37 | {...} | ExitMethods.cs:91:35:91:37 | {...} |
| ExitMethods.cs:8:5:11:5 | {...} | ExitMethods.cs:8:5:11:5 | {...} |
| ExitMethods.cs:9:9:9:24 | call to method ErrorMaybe | ExitMethods.cs:9:20:9:23 | true |
| ExitMethods.cs:9:9:9:25 | ...; | ExitMethods.cs:9:9:9:25 | ...; |
| ExitMethods.cs:9:20:9:23 | true | ExitMethods.cs:9:20:9:23 | true |
| ExitMethods.cs:10:9:10:15 | return ...; | ExitMethods.cs:10:9:10:15 | return ...; |
| ExitMethods.cs:14:5:17:5 | {...} | ExitMethods.cs:14:5:17:5 | {...} |
| ExitMethods.cs:15:9:15:25 | call to method ErrorMaybe | ExitMethods.cs:15:20:15:24 | false |
| ExitMethods.cs:15:9:15:26 | ...; | ExitMethods.cs:15:9:15:26 | ...; |
| ExitMethods.cs:15:20:15:24 | false | ExitMethods.cs:15:20:15:24 | false |
| ExitMethods.cs:16:9:16:15 | return ...; | ExitMethods.cs:16:9:16:15 | return ...; |
| ExitMethods.cs:20:5:23:5 | {...} | ExitMethods.cs:20:5:23:5 | {...} |
| ExitMethods.cs:21:9:21:25 | call to method ErrorAlways | ExitMethods.cs:21:21:21:24 | true |
| ExitMethods.cs:21:9:21:26 | ...; | ExitMethods.cs:21:9:21:26 | ...; |
| ExitMethods.cs:21:21:21:24 | true | ExitMethods.cs:21:21:21:24 | true |
| ExitMethods.cs:22:9:22:15 | return ...; | ExitMethods.cs:22:9:22:15 | return ...; |
| ExitMethods.cs:26:5:29:5 | {...} | ExitMethods.cs:26:5:29:5 | {...} |
| ExitMethods.cs:27:9:27:14 | call to method Exit | ExitMethods.cs:27:9:27:14 | this access |
| ExitMethods.cs:27:9:27:14 | this access | ExitMethods.cs:27:9:27:14 | this access |
| ExitMethods.cs:27:9:27:15 | ...; | ExitMethods.cs:27:9:27:15 | ...; |
| ExitMethods.cs:28:9:28:15 | return ...; | ExitMethods.cs:28:9:28:15 | return ...; |
| ExitMethods.cs:32:5:35:5 | {...} | ExitMethods.cs:32:5:35:5 | {...} |
| ExitMethods.cs:33:9:33:25 | call to method ApplicationExit | ExitMethods.cs:33:9:33:25 | this access |
| ExitMethods.cs:33:9:33:25 | this access | ExitMethods.cs:33:9:33:25 | this access |
| ExitMethods.cs:33:9:33:26 | ...; | ExitMethods.cs:33:9:33:26 | ...; |
| ExitMethods.cs:34:9:34:15 | return ...; | ExitMethods.cs:34:9:34:15 | return ...; |
| ExitMethods.cs:38:5:51:5 | {...} | ExitMethods.cs:38:5:51:5 | {...} |
| ExitMethods.cs:39:9:50:9 | try {...} ... | ExitMethods.cs:39:9:50:9 | try {...} ... |
| ExitMethods.cs:40:9:42:9 | {...} | ExitMethods.cs:40:9:42:9 | {...} |
| ExitMethods.cs:41:13:41:30 | call to method ErrorAlways | ExitMethods.cs:41:25:41:29 | false |
| ExitMethods.cs:41:13:41:31 | ...; | ExitMethods.cs:41:13:41:31 | ...; |
| ExitMethods.cs:41:25:41:29 | false | ExitMethods.cs:41:25:41:29 | false |
| ExitMethods.cs:43:9:46:9 | catch (...) {...} | ExitMethods.cs:43:9:46:9 | catch (...) {...} |
| ExitMethods.cs:44:9:46:9 | {...} | ExitMethods.cs:44:9:46:9 | {...} |
| ExitMethods.cs:45:13:45:19 | return ...; | ExitMethods.cs:45:13:45:19 | return ...; |
| ExitMethods.cs:47:9:50:9 | catch (...) {...} | ExitMethods.cs:47:9:50:9 | catch (...) {...} |
| ExitMethods.cs:48:9:50:9 | {...} | ExitMethods.cs:48:9:50:9 | {...} |
| ExitMethods.cs:49:13:49:19 | return ...; | ExitMethods.cs:49:13:49:19 | return ...; |
| ExitMethods.cs:54:5:57:5 | {...} | ExitMethods.cs:54:5:57:5 | {...} |
| ExitMethods.cs:55:9:56:34 | if (...) ... | ExitMethods.cs:55:9:56:34 | if (...) ... |
| ExitMethods.cs:55:13:55:13 | access to parameter b | ExitMethods.cs:55:13:55:13 | access to parameter b |
| ExitMethods.cs:56:13:56:34 | throw ...; | ExitMethods.cs:56:19:56:33 | object creation of type Exception |
| ExitMethods.cs:56:19:56:33 | object creation of type Exception | ExitMethods.cs:56:19:56:33 | object creation of type Exception |
| ExitMethods.cs:60:5:65:5 | {...} | ExitMethods.cs:60:5:65:5 | {...} |
| ExitMethods.cs:61:9:64:45 | if (...) ... | ExitMethods.cs:61:9:64:45 | if (...) ... |
| ExitMethods.cs:61:13:61:13 | access to parameter b | ExitMethods.cs:61:13:61:13 | access to parameter b |
| ExitMethods.cs:62:13:62:34 | throw ...; | ExitMethods.cs:62:19:62:33 | object creation of type Exception |
| ExitMethods.cs:62:19:62:33 | object creation of type Exception | ExitMethods.cs:62:19:62:33 | object creation of type Exception |
| ExitMethods.cs:64:13:64:45 | throw ...; | ExitMethods.cs:64:41:64:43 | "b" |
| ExitMethods.cs:64:19:64:44 | object creation of type ArgumentException | ExitMethods.cs:64:41:64:43 | "b" |
| ExitMethods.cs:64:41:64:43 | "b" | ExitMethods.cs:64:41:64:43 | "b" |
| ExitMethods.cs:68:5:70:5 | {...} | ExitMethods.cs:68:5:70:5 | {...} |
| ExitMethods.cs:69:9:69:27 | call to method Exit | ExitMethods.cs:69:26:69:26 | 0 |
| ExitMethods.cs:69:9:69:28 | ...; | ExitMethods.cs:69:9:69:28 | ...; |
| ExitMethods.cs:69:26:69:26 | 0 | ExitMethods.cs:69:26:69:26 | 0 |
| ExitMethods.cs:73:5:83:5 | {...} | ExitMethods.cs:73:5:83:5 | {...} |
| ExitMethods.cs:74:9:82:9 | try {...} ... | ExitMethods.cs:74:9:82:9 | try {...} ... |
| ExitMethods.cs:75:9:77:9 | {...} | ExitMethods.cs:75:9:77:9 | {...} |
| ExitMethods.cs:76:13:76:18 | call to method Exit | ExitMethods.cs:76:13:76:18 | this access |
| ExitMethods.cs:76:13:76:18 | this access | ExitMethods.cs:76:13:76:18 | this access |
| ExitMethods.cs:76:13:76:19 | ...; | ExitMethods.cs:76:13:76:19 | ...; |
| ExitMethods.cs:79:9:82:9 | {...} | ExitMethods.cs:79:9:82:9 | {...} |
| ExitMethods.cs:81:13:81:40 | call to method WriteLine | ExitMethods.cs:81:38:81:39 | "" |
| ExitMethods.cs:81:13:81:41 | ...; | ExitMethods.cs:81:13:81:41 | ...; |
| ExitMethods.cs:81:38:81:39 | "" | ExitMethods.cs:81:38:81:39 | "" |
| ExitMethods.cs:86:5:88:5 | {...} | ExitMethods.cs:86:5:88:5 | {...} |
| ExitMethods.cs:87:9:87:47 | call to method Exit | ExitMethods.cs:87:9:87:47 | call to method Exit |
| ExitMethods.cs:87:9:87:48 | ...; | ExitMethods.cs:87:9:87:48 | ...; |
| ExitMethods.cs:91:5:93:5 | {...} | ExitMethods.cs:91:5:93:5 | {...} |
| ExitMethods.cs:92:9:92:77 | return ...; | ExitMethods.cs:92:16:92:76 | ... ? ... : ... |
| ExitMethods.cs:92:16:92:20 | access to parameter input | ExitMethods.cs:92:16:92:20 | access to parameter input |
| ExitMethods.cs:92:16:92:25 | ... != ... | ExitMethods.cs:92:16:92:20 | access to parameter input |
| ExitMethods.cs:92:16:92:76 | ... ? ... : ... | ExitMethods.cs:92:16:92:76 | ... ? ... : ... |
| ExitMethods.cs:92:25:92:25 | 0 | ExitMethods.cs:92:25:92:25 | 0 |
| ExitMethods.cs:92:25:92:25 | (...) ... | ExitMethods.cs:92:25:92:25 | 0 |
| ExitMethods.cs:92:29:92:29 | 1 | ExitMethods.cs:92:29:92:29 | 1 |
| ExitMethods.cs:92:29:92:29 | (...) ... | ExitMethods.cs:92:29:92:29 | 1 |
| ExitMethods.cs:92:29:92:37 | ... / ... | ExitMethods.cs:92:29:92:29 | 1 |
| ExitMethods.cs:92:33:92:37 | access to parameter input | ExitMethods.cs:92:33:92:37 | access to parameter input |
| ExitMethods.cs:92:41:92:76 | throw ... | ExitMethods.cs:92:69:92:75 | "input" |
| ExitMethods.cs:92:47:92:76 | object creation of type ArgumentException | ExitMethods.cs:92:69:92:75 | "input" |
| ExitMethods.cs:92:69:92:75 | "input" | ExitMethods.cs:92:69:92:75 | "input" |
| ExitMethods.cs:96:5:98:5 | {...} | ExitMethods.cs:96:5:98:5 | {...} |
| ExitMethods.cs:97:9:97:39 | return ...; | ExitMethods.cs:97:16:97:38 | ... ? ... : ... |
| ExitMethods.cs:97:16:97:16 | access to parameter s | ExitMethods.cs:97:16:97:16 | access to parameter s |
| ExitMethods.cs:97:16:97:30 | call to method Contains | ExitMethods.cs:97:16:97:16 | access to parameter s |
| ExitMethods.cs:97:16:97:38 | ... ? ... : ... | ExitMethods.cs:97:16:97:38 | ... ? ... : ... |
| ExitMethods.cs:97:27:97:29 | - | ExitMethods.cs:97:27:97:29 | - |
| ExitMethods.cs:97:34:97:34 | 0 | ExitMethods.cs:97:34:97:34 | 0 |
| ExitMethods.cs:97:38:97:38 | 1 | ExitMethods.cs:97:38:97:38 | 1 |
| ExitMethods.cs:101:5:104:5 | {...} | ExitMethods.cs:101:5:104:5 | {...} |
| ExitMethods.cs:102:9:102:28 | call to method IsTrue | ExitMethods.cs:102:23:102:27 | false |
| ExitMethods.cs:102:9:102:29 | ...; | ExitMethods.cs:102:9:102:29 | ...; |
| ExitMethods.cs:102:23:102:27 | false | ExitMethods.cs:102:23:102:27 | false |
| ExitMethods.cs:103:9:103:18 | ... ...; | ExitMethods.cs:103:9:103:18 | ... ...; |
| ExitMethods.cs:103:13:103:13 | access to local variable x | ExitMethods.cs:103:13:103:13 | access to local variable x |
| ExitMethods.cs:103:13:103:17 | Int32 x = ... | ExitMethods.cs:103:13:103:13 | access to local variable x |
| ExitMethods.cs:103:17:103:17 | 0 | ExitMethods.cs:103:17:103:17 | 0 |
| ExitMethods.cs:107:5:110:5 | {...} | ExitMethods.cs:107:5:110:5 | {...} |
| ExitMethods.cs:108:9:108:26 | call to method FailingAssertion | ExitMethods.cs:108:9:108:26 | this access |
| ExitMethods.cs:108:9:108:26 | this access | ExitMethods.cs:108:9:108:26 | this access |
| ExitMethods.cs:108:9:108:27 | ...; | ExitMethods.cs:108:9:108:27 | ...; |
| ExitMethods.cs:109:9:109:18 | ... ...; | ExitMethods.cs:109:9:109:18 | ... ...; |
| ExitMethods.cs:109:13:109:13 | access to local variable x | ExitMethods.cs:109:13:109:13 | access to local variable x |
| ExitMethods.cs:109:13:109:17 | Int32 x = ... | ExitMethods.cs:109:13:109:13 | access to local variable x |
| ExitMethods.cs:109:17:109:17 | 0 | ExitMethods.cs:109:17:109:17 | 0 |
| ExitMethods.cs:112:33:112:49 | call to method IsFalse | ExitMethods.cs:112:48:112:48 | access to parameter b |
| ExitMethods.cs:112:48:112:48 | access to parameter b | ExitMethods.cs:112:48:112:48 | access to parameter b |
| ExitMethods.cs:115:5:118:5 | {...} | ExitMethods.cs:115:5:118:5 | {...} |
| ExitMethods.cs:116:9:116:25 | call to method AssertFalse | ExitMethods.cs:116:9:116:25 | this access |
| ExitMethods.cs:116:9:116:25 | this access | ExitMethods.cs:116:9:116:25 | this access |
| ExitMethods.cs:116:9:116:26 | ...; | ExitMethods.cs:116:9:116:26 | ...; |
| ExitMethods.cs:116:21:116:24 | true | ExitMethods.cs:116:21:116:24 | true |
| ExitMethods.cs:117:9:117:18 | ... ...; | ExitMethods.cs:117:9:117:18 | ... ...; |
| ExitMethods.cs:117:13:117:13 | access to local variable x | ExitMethods.cs:117:13:117:13 | access to local variable x |
| ExitMethods.cs:117:13:117:17 | Int32 x = ... | ExitMethods.cs:117:13:117:13 | access to local variable x |
| ExitMethods.cs:117:17:117:17 | 0 | ExitMethods.cs:117:17:117:17 | 0 |
| Extensions.cs:6:5:8:5 | {...} | Extensions.cs:6:5:8:5 | {...} |
| Extensions.cs:7:9:7:30 | return ...; | Extensions.cs:7:28:7:28 | access to parameter s |
| Extensions.cs:7:16:7:29 | call to method Parse | Extensions.cs:7:28:7:28 | access to parameter s |

View File

@@ -1,5 +1,6 @@
import csharp
import Common
import ControlFlow::Internal
from ControlFlowElement cfe
from SourceControlFlowElement cfe
select cfe, first(cfe)

View File

@@ -32,19 +32,23 @@
| Conditions.cs:70:9:70:10 | M6 | Conditions.cs:71:5:84:5 | {...} |
| Conditions.cs:86:9:86:10 | M7 | Conditions.cs:87:5:100:5 | {...} |
| Conditions.cs:102:12:102:13 | M8 | Conditions.cs:103:5:111:5 | {...} |
| ExitMethods.cs:6:10:6:11 | M1 | ExitMethods.cs:7:5:10:5 | {...} |
| ExitMethods.cs:12:10:12:11 | M2 | ExitMethods.cs:13:5:16:5 | {...} |
| ExitMethods.cs:18:10:18:11 | M3 | ExitMethods.cs:19:5:22:5 | {...} |
| ExitMethods.cs:24:10:24:11 | M4 | ExitMethods.cs:25:5:28:5 | {...} |
| ExitMethods.cs:30:10:30:11 | M5 | ExitMethods.cs:31:5:34:5 | {...} |
| ExitMethods.cs:36:10:36:11 | M6 | ExitMethods.cs:37:5:50:5 | {...} |
| ExitMethods.cs:52:17:52:26 | ErrorMaybe | ExitMethods.cs:53:5:56:5 | {...} |
| ExitMethods.cs:58:17:58:27 | ErrorAlways | ExitMethods.cs:59:5:64:5 | {...} |
| ExitMethods.cs:66:10:66:13 | Exit | ExitMethods.cs:67:5:69:5 | {...} |
| ExitMethods.cs:71:10:71:24 | ApplicationExit | ExitMethods.cs:72:5:74:5 | {...} |
| ExitMethods.cs:76:13:76:21 | ThrowExpr | ExitMethods.cs:77:5:79:5 | {...} |
| ExitMethods.cs:81:16:81:34 | ExtensionMethodCall | ExitMethods.cs:82:5:84:5 | {...} |
| ExitMethods.cs:91:28:91:31 | Exit | ExitMethods.cs:91:35:91:37 | {...} |
| ExitMethods.cs:7:10:7:11 | M1 | ExitMethods.cs:8:5:11:5 | {...} |
| ExitMethods.cs:13:10:13:11 | M2 | ExitMethods.cs:14:5:17:5 | {...} |
| ExitMethods.cs:19:10:19:11 | M3 | ExitMethods.cs:20:5:23:5 | {...} |
| ExitMethods.cs:25:10:25:11 | M4 | ExitMethods.cs:26:5:29:5 | {...} |
| ExitMethods.cs:31:10:31:11 | M5 | ExitMethods.cs:32:5:35:5 | {...} |
| ExitMethods.cs:37:10:37:11 | M6 | ExitMethods.cs:38:5:51:5 | {...} |
| ExitMethods.cs:53:17:53:26 | ErrorMaybe | ExitMethods.cs:54:5:57:5 | {...} |
| ExitMethods.cs:59:17:59:27 | ErrorAlways | ExitMethods.cs:60:5:65:5 | {...} |
| ExitMethods.cs:67:10:67:13 | Exit | ExitMethods.cs:68:5:70:5 | {...} |
| ExitMethods.cs:72:10:72:18 | ExitInTry | ExitMethods.cs:73:5:83:5 | {...} |
| ExitMethods.cs:85:10:85:24 | ApplicationExit | ExitMethods.cs:86:5:88:5 | {...} |
| ExitMethods.cs:90:13:90:21 | ThrowExpr | ExitMethods.cs:91:5:93:5 | {...} |
| ExitMethods.cs:95:16:95:34 | ExtensionMethodCall | ExitMethods.cs:96:5:98:5 | {...} |
| ExitMethods.cs:100:17:100:32 | FailingAssertion | ExitMethods.cs:101:5:104:5 | {...} |
| ExitMethods.cs:106:17:106:33 | FailingAssertion2 | ExitMethods.cs:107:5:110:5 | {...} |
| ExitMethods.cs:112:10:112:20 | AssertFalse | ExitMethods.cs:112:48:112:48 | access to parameter b |
| ExitMethods.cs:114:17:114:33 | FailingAssertion3 | ExitMethods.cs:115:5:118:5 | {...} |
| Extensions.cs:5:23:5:29 | ToInt32 | Extensions.cs:6:5:8:5 | {...} |
| Extensions.cs:10:24:10:29 | ToBool | Extensions.cs:11:5:13:5 | {...} |
| Extensions.cs:15:23:15:33 | CallToInt32 | Extensions.cs:15:48:15:50 | "0" |

View File

@@ -1,6 +1,7 @@
import csharp
import semmle.code.csharp.controlflow.ControlFlowElement
import Common
from Callable c, ControlFlowElement cfn
from Callable c, SourceControlFlowElement cfn
where c.getEntryPoint().getASuccessor().getElement() = cfn
select c, cfn

View File

@@ -672,110 +672,151 @@
| Conditions.cs:109:22:109:23 | "" | Conditions.cs:109:22:109:23 | "" | normal |
| Conditions.cs:110:9:110:17 | return ...; | Conditions.cs:110:9:110:17 | return ...; | return |
| Conditions.cs:110:16:110:16 | access to local variable x | Conditions.cs:110:16:110:16 | access to local variable x | normal |
| ExitMethods.cs:7:5:10:5 | {...} | ExitMethods.cs:9:9:9:15 | return ...; | return |
| ExitMethods.cs:8:9:8:24 | call to method ErrorMaybe | ExitMethods.cs:8:9:8:24 | call to method ErrorMaybe | normal |
| ExitMethods.cs:8:9:8:25 | ...; | ExitMethods.cs:8:9:8:24 | call to method ErrorMaybe | normal |
| ExitMethods.cs:8:20:8:23 | true | ExitMethods.cs:8:20:8:23 | true | normal |
| ExitMethods.cs:9:9:9:15 | return ...; | ExitMethods.cs:9:9:9:15 | return ...; | return |
| ExitMethods.cs:13:5:16:5 | {...} | ExitMethods.cs:15:9:15:15 | return ...; | return |
| ExitMethods.cs:14:9:14:25 | call to method ErrorMaybe | ExitMethods.cs:14:9:14:25 | call to method ErrorMaybe | normal |
| ExitMethods.cs:14:9:14:26 | ...; | ExitMethods.cs:14:9:14:25 | call to method ErrorMaybe | normal |
| ExitMethods.cs:14:20:14:24 | false | ExitMethods.cs:14:20:14:24 | false | normal |
| ExitMethods.cs:15:9:15:15 | return ...; | ExitMethods.cs:15:9:15:15 | return ...; | return |
| ExitMethods.cs:19:5:22:5 | {...} | ExitMethods.cs:20:9:20:25 | call to method ErrorAlways | throw(ArgumentException) |
| ExitMethods.cs:19:5:22:5 | {...} | ExitMethods.cs:20:9:20:25 | call to method ErrorAlways | throw(Exception) |
| ExitMethods.cs:19:5:22:5 | {...} | ExitMethods.cs:21:9:21:15 | return ...; | return |
| ExitMethods.cs:20:9:20:25 | call to method ErrorAlways | ExitMethods.cs:20:9:20:25 | call to method ErrorAlways | throw(ArgumentException) |
| ExitMethods.cs:20:9:20:25 | call to method ErrorAlways | ExitMethods.cs:20:9:20:25 | call to method ErrorAlways | throw(Exception) |
| ExitMethods.cs:20:9:20:26 | ...; | ExitMethods.cs:20:9:20:25 | call to method ErrorAlways | throw(ArgumentException) |
| ExitMethods.cs:20:9:20:26 | ...; | ExitMethods.cs:20:9:20:25 | call to method ErrorAlways | throw(Exception) |
| ExitMethods.cs:20:21:20:24 | true | ExitMethods.cs:20:21:20:24 | true | normal |
| ExitMethods.cs:21:9:21:15 | return ...; | ExitMethods.cs:21:9:21:15 | return ...; | return |
| ExitMethods.cs:25:5:28:5 | {...} | ExitMethods.cs:26:9:26:14 | call to method Exit | return |
| ExitMethods.cs:25:5:28:5 | {...} | ExitMethods.cs:27:9:27:15 | return ...; | return |
| ExitMethods.cs:26:9:26:14 | call to method Exit | ExitMethods.cs:26:9:26:14 | call to method Exit | return |
| ExitMethods.cs:26:9:26:14 | this access | ExitMethods.cs:26:9:26:14 | this access | normal |
| ExitMethods.cs:26:9:26:15 | ...; | ExitMethods.cs:26:9:26:14 | call to method Exit | return |
| ExitMethods.cs:27:9:27:15 | return ...; | ExitMethods.cs:27:9:27:15 | return ...; | return |
| ExitMethods.cs:31:5:34:5 | {...} | ExitMethods.cs:32:9:32:25 | call to method ApplicationExit | return |
| ExitMethods.cs:31:5:34:5 | {...} | ExitMethods.cs:33:9:33:15 | return ...; | return |
| ExitMethods.cs:32:9:32:25 | call to method ApplicationExit | ExitMethods.cs:32:9:32:25 | call to method ApplicationExit | return |
| ExitMethods.cs:32:9:32:25 | this access | ExitMethods.cs:32:9:32:25 | this access | normal |
| ExitMethods.cs:32:9:32:26 | ...; | ExitMethods.cs:32:9:32:25 | call to method ApplicationExit | return |
| ExitMethods.cs:33:9:33:15 | return ...; | ExitMethods.cs:33:9:33:15 | return ...; | return |
| ExitMethods.cs:37:5:50:5 | {...} | ExitMethods.cs:44:13:44:19 | return ...; | return |
| ExitMethods.cs:37:5:50:5 | {...} | ExitMethods.cs:48:13:48:19 | return ...; | return |
| ExitMethods.cs:38:9:49:9 | try {...} ... | ExitMethods.cs:44:13:44:19 | return ...; | return |
| ExitMethods.cs:38:9:49:9 | try {...} ... | ExitMethods.cs:48:13:48:19 | return ...; | return |
| ExitMethods.cs:39:9:41:9 | {...} | ExitMethods.cs:40:13:40:30 | call to method ErrorAlways | throw(ArgumentException) |
| ExitMethods.cs:39:9:41:9 | {...} | ExitMethods.cs:40:13:40:30 | call to method ErrorAlways | throw(Exception) |
| ExitMethods.cs:40:13:40:30 | call to method ErrorAlways | ExitMethods.cs:40:13:40:30 | call to method ErrorAlways | throw(ArgumentException) |
| ExitMethods.cs:40:13:40:30 | call to method ErrorAlways | ExitMethods.cs:40:13:40:30 | call to method ErrorAlways | throw(Exception) |
| ExitMethods.cs:40:13:40:31 | ...; | ExitMethods.cs:40:13:40:30 | call to method ErrorAlways | throw(ArgumentException) |
| ExitMethods.cs:40:13:40:31 | ...; | ExitMethods.cs:40:13:40:30 | call to method ErrorAlways | throw(Exception) |
| ExitMethods.cs:40:25:40:29 | false | ExitMethods.cs:40:25:40:29 | false | normal |
| ExitMethods.cs:42:9:45:9 | catch (...) {...} | ExitMethods.cs:42:9:45:9 | catch (...) {...} | no-match |
| ExitMethods.cs:42:9:45:9 | catch (...) {...} | ExitMethods.cs:44:13:44:19 | return ...; | return |
| ExitMethods.cs:43:9:45:9 | {...} | ExitMethods.cs:44:13:44:19 | return ...; | return |
| ExitMethods.cs:44:13:44:19 | return ...; | ExitMethods.cs:44:13:44:19 | return ...; | return |
| ExitMethods.cs:46:9:49:9 | catch (...) {...} | ExitMethods.cs:48:13:48:19 | return ...; | return |
| ExitMethods.cs:47:9:49:9 | {...} | ExitMethods.cs:48:13:48:19 | return ...; | return |
| ExitMethods.cs:48:13:48:19 | return ...; | ExitMethods.cs:48:13:48:19 | return ...; | return |
| ExitMethods.cs:53:5:56:5 | {...} | ExitMethods.cs:54:13:54:13 | access to parameter b | false/false |
| ExitMethods.cs:53:5:56:5 | {...} | ExitMethods.cs:55:13:55:34 | throw ...; | throw(Exception) |
| ExitMethods.cs:54:9:55:34 | if (...) ... | ExitMethods.cs:54:13:54:13 | access to parameter b | false/false |
| ExitMethods.cs:54:9:55:34 | if (...) ... | ExitMethods.cs:55:13:55:34 | throw ...; | throw(Exception) |
| ExitMethods.cs:54:13:54:13 | access to parameter b | ExitMethods.cs:54:13:54:13 | access to parameter b | false/false |
| ExitMethods.cs:54:13:54:13 | access to parameter b | ExitMethods.cs:54:13:54:13 | access to parameter b | true/true |
| ExitMethods.cs:55:13:55:34 | throw ...; | ExitMethods.cs:55:13:55:34 | throw ...; | throw(Exception) |
| ExitMethods.cs:55:19:55:33 | object creation of type Exception | ExitMethods.cs:55:19:55:33 | object creation of type Exception | normal |
| ExitMethods.cs:59:5:64:5 | {...} | ExitMethods.cs:61:13:61:34 | throw ...; | throw(Exception) |
| ExitMethods.cs:59:5:64:5 | {...} | ExitMethods.cs:63:13:63:45 | throw ...; | throw(ArgumentException) |
| ExitMethods.cs:60:9:63:45 | if (...) ... | ExitMethods.cs:61:13:61:34 | throw ...; | throw(Exception) |
| ExitMethods.cs:60:9:63:45 | if (...) ... | ExitMethods.cs:63:13:63:45 | throw ...; | throw(ArgumentException) |
| ExitMethods.cs:60:13:60:13 | access to parameter b | ExitMethods.cs:60:13:60:13 | access to parameter b | false/false |
| ExitMethods.cs:60:13:60:13 | access to parameter b | ExitMethods.cs:60:13:60:13 | access to parameter b | true/true |
| ExitMethods.cs:61:13:61:34 | throw ...; | ExitMethods.cs:61:13:61:34 | throw ...; | throw(Exception) |
| ExitMethods.cs:61:19:61:33 | object creation of type Exception | ExitMethods.cs:61:19:61:33 | object creation of type Exception | normal |
| ExitMethods.cs:63:13:63:45 | throw ...; | ExitMethods.cs:63:13:63:45 | throw ...; | throw(ArgumentException) |
| ExitMethods.cs:63:19:63:44 | object creation of type ArgumentException | ExitMethods.cs:63:19:63:44 | object creation of type ArgumentException | normal |
| ExitMethods.cs:63:41:63:43 | "b" | ExitMethods.cs:63:41:63:43 | "b" | normal |
| ExitMethods.cs:67:5:69:5 | {...} | ExitMethods.cs:68:9:68:27 | call to method Exit | return |
| ExitMethods.cs:68:9:68:27 | call to method Exit | ExitMethods.cs:68:9:68:27 | call to method Exit | return |
| ExitMethods.cs:68:9:68:28 | ...; | ExitMethods.cs:68:9:68:27 | call to method Exit | return |
| ExitMethods.cs:68:26:68:26 | 0 | ExitMethods.cs:68:26:68:26 | 0 | normal |
| ExitMethods.cs:72:5:74:5 | {...} | ExitMethods.cs:73:9:73:47 | call to method Exit | return |
| ExitMethods.cs:73:9:73:47 | call to method Exit | ExitMethods.cs:73:9:73:47 | call to method Exit | return |
| ExitMethods.cs:73:9:73:48 | ...; | ExitMethods.cs:73:9:73:47 | call to method Exit | return |
| ExitMethods.cs:77:5:79:5 | {...} | ExitMethods.cs:78:9:78:77 | return ...; | return |
| ExitMethods.cs:77:5:79:5 | {...} | ExitMethods.cs:78:41:78:76 | throw ... | throw(ArgumentException) |
| ExitMethods.cs:78:9:78:77 | return ...; | ExitMethods.cs:78:9:78:77 | return ...; | return |
| ExitMethods.cs:78:9:78:77 | return ...; | ExitMethods.cs:78:41:78:76 | throw ... | throw(ArgumentException) |
| ExitMethods.cs:78:16:78:20 | access to parameter input | ExitMethods.cs:78:16:78:20 | access to parameter input | normal |
| ExitMethods.cs:78:16:78:25 | ... != ... | ExitMethods.cs:78:16:78:25 | ... != ... | false/false |
| ExitMethods.cs:78:16:78:25 | ... != ... | ExitMethods.cs:78:16:78:25 | ... != ... | true/true |
| ExitMethods.cs:78:16:78:76 | ... ? ... : ... | ExitMethods.cs:78:29:78:37 | ... / ... | normal |
| ExitMethods.cs:78:16:78:76 | ... ? ... : ... | ExitMethods.cs:78:41:78:76 | throw ... | throw(ArgumentException) |
| ExitMethods.cs:78:25:78:25 | 0 | ExitMethods.cs:78:25:78:25 | 0 | normal |
| ExitMethods.cs:78:25:78:25 | (...) ... | ExitMethods.cs:78:25:78:25 | (...) ... | normal |
| ExitMethods.cs:78:29:78:29 | 1 | ExitMethods.cs:78:29:78:29 | 1 | normal |
| ExitMethods.cs:78:29:78:29 | (...) ... | ExitMethods.cs:78:29:78:29 | (...) ... | normal |
| ExitMethods.cs:78:29:78:37 | ... / ... | ExitMethods.cs:78:29:78:37 | ... / ... | normal |
| ExitMethods.cs:78:33:78:37 | access to parameter input | ExitMethods.cs:78:33:78:37 | access to parameter input | normal |
| ExitMethods.cs:78:41:78:76 | throw ... | ExitMethods.cs:78:41:78:76 | throw ... | throw(ArgumentException) |
| ExitMethods.cs:78:47:78:76 | object creation of type ArgumentException | ExitMethods.cs:78:47:78:76 | object creation of type ArgumentException | normal |
| ExitMethods.cs:78:69:78:75 | "input" | ExitMethods.cs:78:69:78:75 | "input" | normal |
| ExitMethods.cs:82:5:84:5 | {...} | ExitMethods.cs:83:9:83:39 | return ...; | return |
| ExitMethods.cs:83:9:83:39 | return ...; | ExitMethods.cs:83:9:83:39 | return ...; | return |
| ExitMethods.cs:83:16:83:16 | access to parameter s | ExitMethods.cs:83:16:83:16 | access to parameter s | normal |
| ExitMethods.cs:83:16:83:30 | call to method Contains | ExitMethods.cs:83:16:83:30 | call to method Contains | false/false |
| ExitMethods.cs:83:16:83:30 | call to method Contains | ExitMethods.cs:83:16:83:30 | call to method Contains | true/true |
| ExitMethods.cs:83:16:83:38 | ... ? ... : ... | ExitMethods.cs:83:34:83:34 | 0 | normal |
| ExitMethods.cs:83:16:83:38 | ... ? ... : ... | ExitMethods.cs:83:38:83:38 | 1 | normal |
| ExitMethods.cs:83:27:83:29 | - | ExitMethods.cs:83:27:83:29 | - | normal |
| ExitMethods.cs:83:34:83:34 | 0 | ExitMethods.cs:83:34:83:34 | 0 | normal |
| ExitMethods.cs:83:38:83:38 | 1 | ExitMethods.cs:83:38:83:38 | 1 | normal |
| ExitMethods.cs:91:35:91:37 | {...} | ExitMethods.cs:91:35:91:37 | {...} | normal |
| ExitMethods.cs:8:5:11:5 | {...} | ExitMethods.cs:10:9:10:15 | return ...; | return |
| ExitMethods.cs:9:9:9:24 | call to method ErrorMaybe | ExitMethods.cs:9:9:9:24 | call to method ErrorMaybe | normal |
| ExitMethods.cs:9:9:9:25 | ...; | ExitMethods.cs:9:9:9:24 | call to method ErrorMaybe | normal |
| ExitMethods.cs:9:20:9:23 | true | ExitMethods.cs:9:20:9:23 | true | normal |
| ExitMethods.cs:10:9:10:15 | return ...; | ExitMethods.cs:10:9:10:15 | return ...; | return |
| ExitMethods.cs:14:5:17:5 | {...} | ExitMethods.cs:16:9:16:15 | return ...; | return |
| ExitMethods.cs:15:9:15:25 | call to method ErrorMaybe | ExitMethods.cs:15:9:15:25 | call to method ErrorMaybe | normal |
| ExitMethods.cs:15:9:15:26 | ...; | ExitMethods.cs:15:9:15:25 | call to method ErrorMaybe | normal |
| ExitMethods.cs:15:20:15:24 | false | ExitMethods.cs:15:20:15:24 | false | normal |
| ExitMethods.cs:16:9:16:15 | return ...; | ExitMethods.cs:16:9:16:15 | return ...; | return |
| ExitMethods.cs:20:5:23:5 | {...} | ExitMethods.cs:21:9:21:25 | call to method ErrorAlways | throw(ArgumentException) |
| ExitMethods.cs:20:5:23:5 | {...} | ExitMethods.cs:21:9:21:25 | call to method ErrorAlways | throw(Exception) |
| ExitMethods.cs:20:5:23:5 | {...} | ExitMethods.cs:22:9:22:15 | return ...; | return |
| ExitMethods.cs:21:9:21:25 | call to method ErrorAlways | ExitMethods.cs:21:9:21:25 | call to method ErrorAlways | throw(ArgumentException) |
| ExitMethods.cs:21:9:21:25 | call to method ErrorAlways | ExitMethods.cs:21:9:21:25 | call to method ErrorAlways | throw(Exception) |
| ExitMethods.cs:21:9:21:26 | ...; | ExitMethods.cs:21:9:21:25 | call to method ErrorAlways | throw(ArgumentException) |
| ExitMethods.cs:21:9:21:26 | ...; | ExitMethods.cs:21:9:21:25 | call to method ErrorAlways | throw(Exception) |
| ExitMethods.cs:21:21:21:24 | true | ExitMethods.cs:21:21:21:24 | true | normal |
| ExitMethods.cs:22:9:22:15 | return ...; | ExitMethods.cs:22:9:22:15 | return ...; | return |
| ExitMethods.cs:26:5:29:5 | {...} | ExitMethods.cs:27:9:27:14 | call to method Exit | exit |
| ExitMethods.cs:26:5:29:5 | {...} | ExitMethods.cs:28:9:28:15 | return ...; | return |
| ExitMethods.cs:27:9:27:14 | call to method Exit | ExitMethods.cs:27:9:27:14 | call to method Exit | exit |
| ExitMethods.cs:27:9:27:14 | this access | ExitMethods.cs:27:9:27:14 | this access | normal |
| ExitMethods.cs:27:9:27:15 | ...; | ExitMethods.cs:27:9:27:14 | call to method Exit | exit |
| ExitMethods.cs:28:9:28:15 | return ...; | ExitMethods.cs:28:9:28:15 | return ...; | return |
| ExitMethods.cs:32:5:35:5 | {...} | ExitMethods.cs:33:9:33:25 | call to method ApplicationExit | exit |
| ExitMethods.cs:32:5:35:5 | {...} | ExitMethods.cs:34:9:34:15 | return ...; | return |
| ExitMethods.cs:33:9:33:25 | call to method ApplicationExit | ExitMethods.cs:33:9:33:25 | call to method ApplicationExit | exit |
| ExitMethods.cs:33:9:33:25 | this access | ExitMethods.cs:33:9:33:25 | this access | normal |
| ExitMethods.cs:33:9:33:26 | ...; | ExitMethods.cs:33:9:33:25 | call to method ApplicationExit | exit |
| ExitMethods.cs:34:9:34:15 | return ...; | ExitMethods.cs:34:9:34:15 | return ...; | return |
| ExitMethods.cs:38:5:51:5 | {...} | ExitMethods.cs:45:13:45:19 | return ...; | return |
| ExitMethods.cs:38:5:51:5 | {...} | ExitMethods.cs:49:13:49:19 | return ...; | return |
| ExitMethods.cs:39:9:50:9 | try {...} ... | ExitMethods.cs:45:13:45:19 | return ...; | return |
| ExitMethods.cs:39:9:50:9 | try {...} ... | ExitMethods.cs:49:13:49:19 | return ...; | return |
| ExitMethods.cs:40:9:42:9 | {...} | ExitMethods.cs:41:13:41:30 | call to method ErrorAlways | throw(ArgumentException) |
| ExitMethods.cs:40:9:42:9 | {...} | ExitMethods.cs:41:13:41:30 | call to method ErrorAlways | throw(Exception) |
| ExitMethods.cs:41:13:41:30 | call to method ErrorAlways | ExitMethods.cs:41:13:41:30 | call to method ErrorAlways | throw(ArgumentException) |
| ExitMethods.cs:41:13:41:30 | call to method ErrorAlways | ExitMethods.cs:41:13:41:30 | call to method ErrorAlways | throw(Exception) |
| ExitMethods.cs:41:13:41:31 | ...; | ExitMethods.cs:41:13:41:30 | call to method ErrorAlways | throw(ArgumentException) |
| ExitMethods.cs:41:13:41:31 | ...; | ExitMethods.cs:41:13:41:30 | call to method ErrorAlways | throw(Exception) |
| ExitMethods.cs:41:25:41:29 | false | ExitMethods.cs:41:25:41:29 | false | normal |
| ExitMethods.cs:43:9:46:9 | catch (...) {...} | ExitMethods.cs:43:9:46:9 | catch (...) {...} | no-match |
| ExitMethods.cs:43:9:46:9 | catch (...) {...} | ExitMethods.cs:45:13:45:19 | return ...; | return |
| ExitMethods.cs:44:9:46:9 | {...} | ExitMethods.cs:45:13:45:19 | return ...; | return |
| ExitMethods.cs:45:13:45:19 | return ...; | ExitMethods.cs:45:13:45:19 | return ...; | return |
| ExitMethods.cs:47:9:50:9 | catch (...) {...} | ExitMethods.cs:49:13:49:19 | return ...; | return |
| ExitMethods.cs:48:9:50:9 | {...} | ExitMethods.cs:49:13:49:19 | return ...; | return |
| ExitMethods.cs:49:13:49:19 | return ...; | ExitMethods.cs:49:13:49:19 | return ...; | return |
| ExitMethods.cs:54:5:57:5 | {...} | ExitMethods.cs:55:13:55:13 | access to parameter b | false/false |
| ExitMethods.cs:54:5:57:5 | {...} | ExitMethods.cs:56:13:56:34 | throw ...; | throw(Exception) |
| ExitMethods.cs:55:9:56:34 | if (...) ... | ExitMethods.cs:55:13:55:13 | access to parameter b | false/false |
| ExitMethods.cs:55:9:56:34 | if (...) ... | ExitMethods.cs:56:13:56:34 | throw ...; | throw(Exception) |
| ExitMethods.cs:55:13:55:13 | access to parameter b | ExitMethods.cs:55:13:55:13 | access to parameter b | false/false |
| ExitMethods.cs:55:13:55:13 | access to parameter b | ExitMethods.cs:55:13:55:13 | access to parameter b | true/true |
| ExitMethods.cs:56:13:56:34 | throw ...; | ExitMethods.cs:56:13:56:34 | throw ...; | throw(Exception) |
| ExitMethods.cs:56:19:56:33 | object creation of type Exception | ExitMethods.cs:56:19:56:33 | object creation of type Exception | normal |
| ExitMethods.cs:60:5:65:5 | {...} | ExitMethods.cs:62:13:62:34 | throw ...; | throw(Exception) |
| ExitMethods.cs:60:5:65:5 | {...} | ExitMethods.cs:64:13:64:45 | throw ...; | throw(ArgumentException) |
| ExitMethods.cs:61:9:64:45 | if (...) ... | ExitMethods.cs:62:13:62:34 | throw ...; | throw(Exception) |
| ExitMethods.cs:61:9:64:45 | if (...) ... | ExitMethods.cs:64:13:64:45 | throw ...; | throw(ArgumentException) |
| ExitMethods.cs:61:13:61:13 | access to parameter b | ExitMethods.cs:61:13:61:13 | access to parameter b | false/false |
| ExitMethods.cs:61:13:61:13 | access to parameter b | ExitMethods.cs:61:13:61:13 | access to parameter b | true/true |
| ExitMethods.cs:62:13:62:34 | throw ...; | ExitMethods.cs:62:13:62:34 | throw ...; | throw(Exception) |
| ExitMethods.cs:62:19:62:33 | object creation of type Exception | ExitMethods.cs:62:19:62:33 | object creation of type Exception | normal |
| ExitMethods.cs:64:13:64:45 | throw ...; | ExitMethods.cs:64:13:64:45 | throw ...; | throw(ArgumentException) |
| ExitMethods.cs:64:19:64:44 | object creation of type ArgumentException | ExitMethods.cs:64:19:64:44 | object creation of type ArgumentException | normal |
| ExitMethods.cs:64:41:64:43 | "b" | ExitMethods.cs:64:41:64:43 | "b" | normal |
| ExitMethods.cs:68:5:70:5 | {...} | ExitMethods.cs:69:9:69:27 | call to method Exit | exit |
| ExitMethods.cs:69:9:69:27 | call to method Exit | ExitMethods.cs:69:9:69:27 | call to method Exit | exit |
| ExitMethods.cs:69:9:69:28 | ...; | ExitMethods.cs:69:9:69:27 | call to method Exit | exit |
| ExitMethods.cs:69:26:69:26 | 0 | ExitMethods.cs:69:26:69:26 | 0 | normal |
| ExitMethods.cs:73:5:83:5 | {...} | ExitMethods.cs:76:13:76:18 | call to method Exit | exit |
| ExitMethods.cs:73:5:83:5 | {...} | ExitMethods.cs:81:13:81:40 | call to method WriteLine | exit |
| ExitMethods.cs:74:9:82:9 | try {...} ... | ExitMethods.cs:76:13:76:18 | call to method Exit | exit |
| ExitMethods.cs:74:9:82:9 | try {...} ... | ExitMethods.cs:81:13:81:40 | call to method WriteLine | exit |
| ExitMethods.cs:75:9:77:9 | {...} | ExitMethods.cs:76:13:76:18 | call to method Exit | exit |
| ExitMethods.cs:76:13:76:18 | call to method Exit | ExitMethods.cs:76:13:76:18 | call to method Exit | exit |
| ExitMethods.cs:76:13:76:18 | this access | ExitMethods.cs:76:13:76:18 | this access | normal |
| ExitMethods.cs:76:13:76:19 | ...; | ExitMethods.cs:76:13:76:18 | call to method Exit | exit |
| ExitMethods.cs:79:9:82:9 | {...} | ExitMethods.cs:81:13:81:40 | call to method WriteLine | normal |
| ExitMethods.cs:81:13:81:40 | call to method WriteLine | ExitMethods.cs:81:13:81:40 | call to method WriteLine | normal |
| ExitMethods.cs:81:13:81:41 | ...; | ExitMethods.cs:81:13:81:40 | call to method WriteLine | normal |
| ExitMethods.cs:81:38:81:39 | "" | ExitMethods.cs:81:38:81:39 | "" | normal |
| ExitMethods.cs:86:5:88:5 | {...} | ExitMethods.cs:87:9:87:47 | call to method Exit | exit |
| ExitMethods.cs:87:9:87:47 | call to method Exit | ExitMethods.cs:87:9:87:47 | call to method Exit | exit |
| ExitMethods.cs:87:9:87:48 | ...; | ExitMethods.cs:87:9:87:47 | call to method Exit | exit |
| ExitMethods.cs:91:5:93:5 | {...} | ExitMethods.cs:92:9:92:77 | return ...; | return |
| ExitMethods.cs:91:5:93:5 | {...} | ExitMethods.cs:92:41:92:76 | throw ... | throw(ArgumentException) |
| ExitMethods.cs:92:9:92:77 | return ...; | ExitMethods.cs:92:9:92:77 | return ...; | return |
| ExitMethods.cs:92:9:92:77 | return ...; | ExitMethods.cs:92:41:92:76 | throw ... | throw(ArgumentException) |
| ExitMethods.cs:92:16:92:20 | access to parameter input | ExitMethods.cs:92:16:92:20 | access to parameter input | normal |
| ExitMethods.cs:92:16:92:25 | ... != ... | ExitMethods.cs:92:16:92:25 | ... != ... | false/false |
| ExitMethods.cs:92:16:92:25 | ... != ... | ExitMethods.cs:92:16:92:25 | ... != ... | true/true |
| ExitMethods.cs:92:16:92:76 | ... ? ... : ... | ExitMethods.cs:92:29:92:37 | ... / ... | normal |
| ExitMethods.cs:92:16:92:76 | ... ? ... : ... | ExitMethods.cs:92:41:92:76 | throw ... | throw(ArgumentException) |
| ExitMethods.cs:92:25:92:25 | 0 | ExitMethods.cs:92:25:92:25 | 0 | normal |
| ExitMethods.cs:92:25:92:25 | (...) ... | ExitMethods.cs:92:25:92:25 | (...) ... | normal |
| ExitMethods.cs:92:29:92:29 | 1 | ExitMethods.cs:92:29:92:29 | 1 | normal |
| ExitMethods.cs:92:29:92:29 | (...) ... | ExitMethods.cs:92:29:92:29 | (...) ... | normal |
| ExitMethods.cs:92:29:92:37 | ... / ... | ExitMethods.cs:92:29:92:37 | ... / ... | normal |
| ExitMethods.cs:92:33:92:37 | access to parameter input | ExitMethods.cs:92:33:92:37 | access to parameter input | normal |
| ExitMethods.cs:92:41:92:76 | throw ... | ExitMethods.cs:92:41:92:76 | throw ... | throw(ArgumentException) |
| ExitMethods.cs:92:47:92:76 | object creation of type ArgumentException | ExitMethods.cs:92:47:92:76 | object creation of type ArgumentException | normal |
| ExitMethods.cs:92:69:92:75 | "input" | ExitMethods.cs:92:69:92:75 | "input" | normal |
| ExitMethods.cs:96:5:98:5 | {...} | ExitMethods.cs:97:9:97:39 | return ...; | return |
| ExitMethods.cs:97:9:97:39 | return ...; | ExitMethods.cs:97:9:97:39 | return ...; | return |
| ExitMethods.cs:97:16:97:16 | access to parameter s | ExitMethods.cs:97:16:97:16 | access to parameter s | normal |
| ExitMethods.cs:97:16:97:30 | call to method Contains | ExitMethods.cs:97:16:97:30 | call to method Contains | false/false |
| ExitMethods.cs:97:16:97:30 | call to method Contains | ExitMethods.cs:97:16:97:30 | call to method Contains | true/true |
| ExitMethods.cs:97:16:97:38 | ... ? ... : ... | ExitMethods.cs:97:34:97:34 | 0 | normal |
| ExitMethods.cs:97:16:97:38 | ... ? ... : ... | ExitMethods.cs:97:38:97:38 | 1 | normal |
| ExitMethods.cs:97:27:97:29 | - | ExitMethods.cs:97:27:97:29 | - | normal |
| ExitMethods.cs:97:34:97:34 | 0 | ExitMethods.cs:97:34:97:34 | 0 | normal |
| ExitMethods.cs:97:38:97:38 | 1 | ExitMethods.cs:97:38:97:38 | 1 | normal |
| ExitMethods.cs:101:5:104:5 | {...} | ExitMethods.cs:102:9:102:28 | call to method IsTrue | throw(AssertFailedException) |
| ExitMethods.cs:101:5:104:5 | {...} | ExitMethods.cs:103:13:103:17 | Int32 x = ... | normal |
| ExitMethods.cs:102:9:102:28 | call to method IsTrue | ExitMethods.cs:102:9:102:28 | call to method IsTrue | throw(AssertFailedException) |
| ExitMethods.cs:102:9:102:29 | ...; | ExitMethods.cs:102:9:102:28 | call to method IsTrue | throw(AssertFailedException) |
| ExitMethods.cs:102:23:102:27 | false | ExitMethods.cs:102:23:102:27 | false | normal |
| ExitMethods.cs:103:9:103:18 | ... ...; | ExitMethods.cs:103:13:103:17 | Int32 x = ... | normal |
| ExitMethods.cs:103:13:103:13 | access to local variable x | ExitMethods.cs:103:13:103:13 | access to local variable x | normal |
| ExitMethods.cs:103:13:103:17 | Int32 x = ... | ExitMethods.cs:103:13:103:17 | Int32 x = ... | normal |
| ExitMethods.cs:103:17:103:17 | 0 | ExitMethods.cs:103:17:103:17 | 0 | normal |
| ExitMethods.cs:107:5:110:5 | {...} | ExitMethods.cs:108:9:108:26 | call to method FailingAssertion | throw(AssertFailedException) |
| ExitMethods.cs:107:5:110:5 | {...} | ExitMethods.cs:109:13:109:17 | Int32 x = ... | normal |
| ExitMethods.cs:108:9:108:26 | call to method FailingAssertion | ExitMethods.cs:108:9:108:26 | call to method FailingAssertion | throw(AssertFailedException) |
| ExitMethods.cs:108:9:108:26 | this access | ExitMethods.cs:108:9:108:26 | this access | normal |
| ExitMethods.cs:108:9:108:27 | ...; | ExitMethods.cs:108:9:108:26 | call to method FailingAssertion | throw(AssertFailedException) |
| ExitMethods.cs:109:9:109:18 | ... ...; | ExitMethods.cs:109:13:109:17 | Int32 x = ... | normal |
| ExitMethods.cs:109:13:109:13 | access to local variable x | ExitMethods.cs:109:13:109:13 | access to local variable x | normal |
| ExitMethods.cs:109:13:109:17 | Int32 x = ... | ExitMethods.cs:109:13:109:17 | Int32 x = ... | normal |
| ExitMethods.cs:109:17:109:17 | 0 | ExitMethods.cs:109:17:109:17 | 0 | normal |
| ExitMethods.cs:112:33:112:49 | call to method IsFalse | ExitMethods.cs:112:33:112:49 | call to method IsFalse | normal |
| ExitMethods.cs:112:48:112:48 | access to parameter b | ExitMethods.cs:112:48:112:48 | access to parameter b | normal |
| ExitMethods.cs:115:5:118:5 | {...} | ExitMethods.cs:116:9:116:25 | call to method AssertFalse | throw(AssertFailedException) |
| ExitMethods.cs:115:5:118:5 | {...} | ExitMethods.cs:117:13:117:17 | Int32 x = ... | normal |
| ExitMethods.cs:116:9:116:25 | call to method AssertFalse | ExitMethods.cs:116:9:116:25 | call to method AssertFalse | throw(AssertFailedException) |
| ExitMethods.cs:116:9:116:25 | this access | ExitMethods.cs:116:9:116:25 | this access | normal |
| ExitMethods.cs:116:9:116:26 | ...; | ExitMethods.cs:116:9:116:25 | call to method AssertFalse | throw(AssertFailedException) |
| ExitMethods.cs:116:21:116:24 | true | ExitMethods.cs:116:21:116:24 | true | normal |
| ExitMethods.cs:117:9:117:18 | ... ...; | ExitMethods.cs:117:13:117:17 | Int32 x = ... | normal |
| ExitMethods.cs:117:13:117:13 | access to local variable x | ExitMethods.cs:117:13:117:13 | access to local variable x | normal |
| ExitMethods.cs:117:13:117:17 | Int32 x = ... | ExitMethods.cs:117:13:117:17 | Int32 x = ... | normal |
| ExitMethods.cs:117:17:117:17 | 0 | ExitMethods.cs:117:17:117:17 | 0 | normal |
| Extensions.cs:6:5:8:5 | {...} | Extensions.cs:7:9:7:30 | return ...; | return |
| Extensions.cs:7:9:7:30 | return ...; | Extensions.cs:7:9:7:30 | return ...; | return |
| Extensions.cs:7:16:7:29 | call to method Parse | Extensions.cs:7:16:7:29 | call to method Parse | normal |

View File

@@ -1,6 +1,7 @@
import csharp
import ControlFlow::Internal
private import semmle.code.csharp.controlflow.Completion
import Common
from ControlFlowElement cfe, Completion c
from SourceControlFlowElement cfe, Completion c
select cfe, last(cfe, c), c

View File

@@ -1,5 +1,6 @@
using System;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
class ExitMethods
{
@@ -68,6 +69,19 @@ class ExitMethods
Environment.Exit(0);
}
void ExitInTry()
{
try
{
Exit();
}
finally
{
// dead
System.Console.WriteLine("");
}
}
void ApplicationExit()
{
System.Windows.Forms.Application.Exit();
@@ -82,12 +96,26 @@ class ExitMethods
{
return s.Contains('-') ? 0 : 1;
}
}
namespace System.Windows.Forms
{
public class Application
public void FailingAssertion()
{
public static void Exit() { }
Assert.IsTrue(false);
var x = 0; // dead
}
public void FailingAssertion2()
{
FailingAssertion();
var x = 0; // dead
}
void AssertFalse(bool b) => Assert.IsFalse(b);
public void FailingAssertion3()
{
AssertFalse(true);
var x = 0; // dead
}
}
// semmle-extractor-options: ${testdir}/../../../resources/stubs/System.Windows.cs ${testdir}/../../../resources/stubs/Microsoft.VisualStudio.TestTools.UnitTesting.cs

View File

@@ -728,104 +728,128 @@
| Conditions.cs:109:22:109:23 | "" | Conditions.cs:109:17:109:23 | ... + ... | semmle.label | successor |
| Conditions.cs:110:9:110:17 | return ...; | Conditions.cs:102:12:102:13 | exit M8 | semmle.label | return |
| Conditions.cs:110:16:110:16 | access to local variable x | Conditions.cs:110:9:110:17 | return ...; | semmle.label | successor |
| ExitMethods.cs:6:10:6:11 | enter M1 | ExitMethods.cs:7:5:10:5 | {...} | semmle.label | successor |
| ExitMethods.cs:7:5:10:5 | {...} | ExitMethods.cs:8:9:8:25 | ...; | semmle.label | successor |
| ExitMethods.cs:8:9:8:24 | call to method ErrorMaybe | ExitMethods.cs:9:9:9:15 | return ...; | semmle.label | successor |
| ExitMethods.cs:8:9:8:25 | ...; | ExitMethods.cs:8:20:8:23 | true | semmle.label | successor |
| ExitMethods.cs:8:20:8:23 | true | ExitMethods.cs:8:9:8:24 | call to method ErrorMaybe | semmle.label | successor |
| ExitMethods.cs:9:9:9:15 | return ...; | ExitMethods.cs:6:10:6:11 | exit M1 | semmle.label | return |
| ExitMethods.cs:12:10:12:11 | enter M2 | ExitMethods.cs:13:5:16:5 | {...} | semmle.label | successor |
| ExitMethods.cs:13:5:16:5 | {...} | ExitMethods.cs:14:9:14:26 | ...; | semmle.label | successor |
| ExitMethods.cs:14:9:14:25 | call to method ErrorMaybe | ExitMethods.cs:15:9:15:15 | return ...; | semmle.label | successor |
| ExitMethods.cs:14:9:14:26 | ...; | ExitMethods.cs:14:20:14:24 | false | semmle.label | successor |
| ExitMethods.cs:14:20:14:24 | false | ExitMethods.cs:14:9:14:25 | call to method ErrorMaybe | semmle.label | successor |
| ExitMethods.cs:15:9:15:15 | return ...; | ExitMethods.cs:12:10:12:11 | exit M2 | semmle.label | return |
| ExitMethods.cs:18:10:18:11 | enter M3 | ExitMethods.cs:19:5:22:5 | {...} | semmle.label | successor |
| ExitMethods.cs:19:5:22:5 | {...} | ExitMethods.cs:20:9:20:26 | ...; | semmle.label | successor |
| ExitMethods.cs:20:9:20:25 | call to method ErrorAlways | ExitMethods.cs:18:10:18:11 | exit M3 | semmle.label | exception(ArgumentException) |
| ExitMethods.cs:20:9:20:25 | call to method ErrorAlways | ExitMethods.cs:18:10:18:11 | exit M3 | semmle.label | exception(Exception) |
| ExitMethods.cs:20:9:20:26 | ...; | ExitMethods.cs:20:21:20:24 | true | semmle.label | successor |
| ExitMethods.cs:20:21:20:24 | true | ExitMethods.cs:20:9:20:25 | call to method ErrorAlways | semmle.label | successor |
| ExitMethods.cs:24:10:24:11 | enter M4 | ExitMethods.cs:25:5:28:5 | {...} | semmle.label | successor |
| ExitMethods.cs:25:5:28:5 | {...} | ExitMethods.cs:26:9:26:15 | ...; | semmle.label | successor |
| ExitMethods.cs:26:9:26:14 | call to method Exit | ExitMethods.cs:24:10:24:11 | exit M4 | semmle.label | return |
| ExitMethods.cs:26:9:26:14 | this access | ExitMethods.cs:26:9:26:14 | call to method Exit | semmle.label | successor |
| ExitMethods.cs:26:9:26:15 | ...; | ExitMethods.cs:26:9:26:14 | this access | semmle.label | successor |
| ExitMethods.cs:30:10:30:11 | enter M5 | ExitMethods.cs:31:5:34:5 | {...} | semmle.label | successor |
| ExitMethods.cs:31:5:34:5 | {...} | ExitMethods.cs:32:9:32:26 | ...; | semmle.label | successor |
| ExitMethods.cs:32:9:32:25 | call to method ApplicationExit | ExitMethods.cs:30:10:30:11 | exit M5 | semmle.label | return |
| ExitMethods.cs:32:9:32:25 | this access | ExitMethods.cs:32:9:32:25 | call to method ApplicationExit | semmle.label | successor |
| ExitMethods.cs:32:9:32:26 | ...; | ExitMethods.cs:32:9:32:25 | this access | semmle.label | successor |
| ExitMethods.cs:36:10:36:11 | enter M6 | ExitMethods.cs:37:5:50:5 | {...} | semmle.label | successor |
| ExitMethods.cs:37:5:50:5 | {...} | ExitMethods.cs:38:9:49:9 | try {...} ... | semmle.label | successor |
| ExitMethods.cs:38:9:49:9 | try {...} ... | ExitMethods.cs:39:9:41:9 | {...} | semmle.label | successor |
| ExitMethods.cs:39:9:41:9 | {...} | ExitMethods.cs:40:13:40:31 | ...; | semmle.label | successor |
| ExitMethods.cs:40:13:40:30 | call to method ErrorAlways | ExitMethods.cs:42:9:45:9 | [exception: ArgumentException] catch (...) {...} | semmle.label | exception(ArgumentException) |
| ExitMethods.cs:40:13:40:30 | call to method ErrorAlways | ExitMethods.cs:42:9:45:9 | [exception: Exception] catch (...) {...} | semmle.label | exception(Exception) |
| ExitMethods.cs:40:13:40:31 | ...; | ExitMethods.cs:40:25:40:29 | false | semmle.label | successor |
| ExitMethods.cs:40:25:40:29 | false | ExitMethods.cs:40:13:40:30 | call to method ErrorAlways | semmle.label | successor |
| ExitMethods.cs:42:9:45:9 | [exception: ArgumentException] catch (...) {...} | ExitMethods.cs:43:9:45:9 | {...} | semmle.label | match |
| ExitMethods.cs:42:9:45:9 | [exception: Exception] catch (...) {...} | ExitMethods.cs:43:9:45:9 | {...} | semmle.label | match |
| ExitMethods.cs:42:9:45:9 | [exception: Exception] catch (...) {...} | ExitMethods.cs:46:9:49:9 | [exception: Exception] catch (...) {...} | semmle.label | no-match |
| ExitMethods.cs:43:9:45:9 | {...} | ExitMethods.cs:44:13:44:19 | return ...; | semmle.label | successor |
| ExitMethods.cs:44:13:44:19 | return ...; | ExitMethods.cs:36:10:36:11 | exit M6 | semmle.label | return |
| ExitMethods.cs:46:9:49:9 | [exception: Exception] catch (...) {...} | ExitMethods.cs:47:9:49:9 | {...} | semmle.label | match |
| ExitMethods.cs:47:9:49:9 | {...} | ExitMethods.cs:48:13:48:19 | return ...; | semmle.label | successor |
| ExitMethods.cs:48:13:48:19 | return ...; | ExitMethods.cs:36:10:36:11 | exit M6 | semmle.label | return |
| ExitMethods.cs:52:17:52:26 | enter ErrorMaybe | ExitMethods.cs:53:5:56:5 | {...} | semmle.label | successor |
| ExitMethods.cs:53:5:56:5 | {...} | ExitMethods.cs:54:9:55:34 | if (...) ... | semmle.label | successor |
| ExitMethods.cs:54:9:55:34 | if (...) ... | ExitMethods.cs:54:13:54:13 | access to parameter b | semmle.label | successor |
| ExitMethods.cs:54:13:54:13 | access to parameter b | ExitMethods.cs:52:17:52:26 | exit ErrorMaybe | semmle.label | false |
| ExitMethods.cs:54:13:54:13 | access to parameter b | ExitMethods.cs:55:19:55:33 | object creation of type Exception | semmle.label | true |
| ExitMethods.cs:55:13:55:34 | throw ...; | ExitMethods.cs:52:17:52:26 | exit ErrorMaybe | semmle.label | exception(Exception) |
| ExitMethods.cs:55:19:55:33 | object creation of type Exception | ExitMethods.cs:55:13:55:34 | throw ...; | semmle.label | successor |
| ExitMethods.cs:58:17:58:27 | enter ErrorAlways | ExitMethods.cs:59:5:64:5 | {...} | semmle.label | successor |
| ExitMethods.cs:59:5:64:5 | {...} | ExitMethods.cs:60:9:63:45 | if (...) ... | semmle.label | successor |
| ExitMethods.cs:60:9:63:45 | if (...) ... | ExitMethods.cs:60:13:60:13 | access to parameter b | semmle.label | successor |
| ExitMethods.cs:60:13:60:13 | access to parameter b | ExitMethods.cs:61:19:61:33 | object creation of type Exception | semmle.label | true |
| ExitMethods.cs:60:13:60:13 | access to parameter b | ExitMethods.cs:63:41:63:43 | "b" | semmle.label | false |
| ExitMethods.cs:61:13:61:34 | throw ...; | ExitMethods.cs:58:17:58:27 | exit ErrorAlways | semmle.label | exception(Exception) |
| ExitMethods.cs:61:19:61:33 | object creation of type Exception | ExitMethods.cs:61:13:61:34 | throw ...; | semmle.label | successor |
| ExitMethods.cs:63:13:63:45 | throw ...; | ExitMethods.cs:58:17:58:27 | exit ErrorAlways | semmle.label | exception(ArgumentException) |
| ExitMethods.cs:63:19:63:44 | object creation of type ArgumentException | ExitMethods.cs:63:13:63:45 | throw ...; | semmle.label | successor |
| ExitMethods.cs:63:41:63:43 | "b" | ExitMethods.cs:63:19:63:44 | object creation of type ArgumentException | semmle.label | successor |
| ExitMethods.cs:66:10:66:13 | enter Exit | ExitMethods.cs:67:5:69:5 | {...} | semmle.label | successor |
| ExitMethods.cs:67:5:69:5 | {...} | ExitMethods.cs:68:9:68:28 | ...; | semmle.label | successor |
| ExitMethods.cs:68:9:68:27 | call to method Exit | ExitMethods.cs:66:10:66:13 | exit Exit | semmle.label | return |
| ExitMethods.cs:68:9:68:28 | ...; | ExitMethods.cs:68:26:68:26 | 0 | semmle.label | successor |
| ExitMethods.cs:68:26:68:26 | 0 | ExitMethods.cs:68:9:68:27 | call to method Exit | semmle.label | successor |
| ExitMethods.cs:71:10:71:24 | enter ApplicationExit | ExitMethods.cs:72:5:74:5 | {...} | semmle.label | successor |
| ExitMethods.cs:72:5:74:5 | {...} | ExitMethods.cs:73:9:73:48 | ...; | semmle.label | successor |
| ExitMethods.cs:73:9:73:47 | call to method Exit | ExitMethods.cs:71:10:71:24 | exit ApplicationExit | semmle.label | return |
| ExitMethods.cs:73:9:73:48 | ...; | ExitMethods.cs:73:9:73:47 | call to method Exit | semmle.label | successor |
| ExitMethods.cs:76:13:76:21 | enter ThrowExpr | ExitMethods.cs:77:5:79:5 | {...} | semmle.label | successor |
| ExitMethods.cs:77:5:79:5 | {...} | ExitMethods.cs:78:16:78:76 | ... ? ... : ... | semmle.label | successor |
| ExitMethods.cs:78:9:78:77 | return ...; | ExitMethods.cs:76:13:76:21 | exit ThrowExpr | semmle.label | return |
| ExitMethods.cs:78:16:78:20 | access to parameter input | ExitMethods.cs:78:25:78:25 | 0 | semmle.label | successor |
| ExitMethods.cs:78:16:78:25 | ... != ... | ExitMethods.cs:78:29:78:29 | 1 | semmle.label | true |
| ExitMethods.cs:78:16:78:25 | ... != ... | ExitMethods.cs:78:69:78:75 | "input" | semmle.label | false |
| ExitMethods.cs:78:16:78:76 | ... ? ... : ... | ExitMethods.cs:78:16:78:20 | access to parameter input | semmle.label | successor |
| ExitMethods.cs:78:25:78:25 | 0 | ExitMethods.cs:78:25:78:25 | (...) ... | semmle.label | successor |
| ExitMethods.cs:78:25:78:25 | (...) ... | ExitMethods.cs:78:16:78:25 | ... != ... | semmle.label | successor |
| ExitMethods.cs:78:29:78:29 | 1 | ExitMethods.cs:78:29:78:29 | (...) ... | semmle.label | successor |
| ExitMethods.cs:78:29:78:29 | (...) ... | ExitMethods.cs:78:33:78:37 | access to parameter input | semmle.label | successor |
| ExitMethods.cs:78:29:78:37 | ... / ... | ExitMethods.cs:78:9:78:77 | return ...; | semmle.label | successor |
| ExitMethods.cs:78:33:78:37 | access to parameter input | ExitMethods.cs:78:29:78:37 | ... / ... | semmle.label | successor |
| ExitMethods.cs:78:41:78:76 | throw ... | ExitMethods.cs:76:13:76:21 | exit ThrowExpr | semmle.label | exception(ArgumentException) |
| ExitMethods.cs:78:47:78:76 | object creation of type ArgumentException | ExitMethods.cs:78:41:78:76 | throw ... | semmle.label | successor |
| ExitMethods.cs:78:69:78:75 | "input" | ExitMethods.cs:78:47:78:76 | object creation of type ArgumentException | semmle.label | successor |
| ExitMethods.cs:81:16:81:34 | enter ExtensionMethodCall | ExitMethods.cs:82:5:84:5 | {...} | semmle.label | successor |
| ExitMethods.cs:82:5:84:5 | {...} | ExitMethods.cs:83:16:83:38 | ... ? ... : ... | semmle.label | successor |
| ExitMethods.cs:83:9:83:39 | return ...; | ExitMethods.cs:81:16:81:34 | exit ExtensionMethodCall | semmle.label | return |
| ExitMethods.cs:83:16:83:16 | access to parameter s | ExitMethods.cs:83:27:83:29 | - | semmle.label | successor |
| ExitMethods.cs:83:16:83:30 | call to method Contains | ExitMethods.cs:83:34:83:34 | 0 | semmle.label | true |
| ExitMethods.cs:83:16:83:30 | call to method Contains | ExitMethods.cs:83:38:83:38 | 1 | semmle.label | false |
| ExitMethods.cs:83:16:83:38 | ... ? ... : ... | ExitMethods.cs:83:16:83:16 | access to parameter s | semmle.label | successor |
| ExitMethods.cs:83:27:83:29 | - | ExitMethods.cs:83:16:83:30 | call to method Contains | semmle.label | successor |
| ExitMethods.cs:83:34:83:34 | 0 | ExitMethods.cs:83:9:83:39 | return ...; | semmle.label | successor |
| ExitMethods.cs:83:38:83:38 | 1 | ExitMethods.cs:83:9:83:39 | return ...; | semmle.label | successor |
| ExitMethods.cs:91:28:91:31 | enter Exit | ExitMethods.cs:91:35:91:37 | {...} | semmle.label | successor |
| ExitMethods.cs:91:35:91:37 | {...} | ExitMethods.cs:91:28:91:31 | exit Exit | semmle.label | successor |
| ExitMethods.cs:7:10:7:11 | enter M1 | ExitMethods.cs:8:5:11:5 | {...} | semmle.label | successor |
| ExitMethods.cs:8:5:11:5 | {...} | ExitMethods.cs:9:9:9:25 | ...; | semmle.label | successor |
| ExitMethods.cs:9:9:9:24 | call to method ErrorMaybe | ExitMethods.cs:10:9:10:15 | return ...; | semmle.label | successor |
| ExitMethods.cs:9:9:9:25 | ...; | ExitMethods.cs:9:20:9:23 | true | semmle.label | successor |
| ExitMethods.cs:9:20:9:23 | true | ExitMethods.cs:9:9:9:24 | call to method ErrorMaybe | semmle.label | successor |
| ExitMethods.cs:10:9:10:15 | return ...; | ExitMethods.cs:7:10:7:11 | exit M1 | semmle.label | return |
| ExitMethods.cs:13:10:13:11 | enter M2 | ExitMethods.cs:14:5:17:5 | {...} | semmle.label | successor |
| ExitMethods.cs:14:5:17:5 | {...} | ExitMethods.cs:15:9:15:26 | ...; | semmle.label | successor |
| ExitMethods.cs:15:9:15:25 | call to method ErrorMaybe | ExitMethods.cs:16:9:16:15 | return ...; | semmle.label | successor |
| ExitMethods.cs:15:9:15:26 | ...; | ExitMethods.cs:15:20:15:24 | false | semmle.label | successor |
| ExitMethods.cs:15:20:15:24 | false | ExitMethods.cs:15:9:15:25 | call to method ErrorMaybe | semmle.label | successor |
| ExitMethods.cs:16:9:16:15 | return ...; | ExitMethods.cs:13:10:13:11 | exit M2 | semmle.label | return |
| ExitMethods.cs:19:10:19:11 | enter M3 | ExitMethods.cs:20:5:23:5 | {...} | semmle.label | successor |
| ExitMethods.cs:20:5:23:5 | {...} | ExitMethods.cs:21:9:21:26 | ...; | semmle.label | successor |
| ExitMethods.cs:21:9:21:25 | call to method ErrorAlways | ExitMethods.cs:19:10:19:11 | exit M3 | semmle.label | exception(ArgumentException) |
| ExitMethods.cs:21:9:21:25 | call to method ErrorAlways | ExitMethods.cs:19:10:19:11 | exit M3 | semmle.label | exception(Exception) |
| ExitMethods.cs:21:9:21:26 | ...; | ExitMethods.cs:21:21:21:24 | true | semmle.label | successor |
| ExitMethods.cs:21:21:21:24 | true | ExitMethods.cs:21:9:21:25 | call to method ErrorAlways | semmle.label | successor |
| ExitMethods.cs:25:10:25:11 | enter M4 | ExitMethods.cs:26:5:29:5 | {...} | semmle.label | successor |
| ExitMethods.cs:26:5:29:5 | {...} | ExitMethods.cs:27:9:27:15 | ...; | semmle.label | successor |
| ExitMethods.cs:27:9:27:14 | call to method Exit | ExitMethods.cs:25:10:25:11 | exit M4 | semmle.label | exit |
| ExitMethods.cs:27:9:27:14 | this access | ExitMethods.cs:27:9:27:14 | call to method Exit | semmle.label | successor |
| ExitMethods.cs:27:9:27:15 | ...; | ExitMethods.cs:27:9:27:14 | this access | semmle.label | successor |
| ExitMethods.cs:31:10:31:11 | enter M5 | ExitMethods.cs:32:5:35:5 | {...} | semmle.label | successor |
| ExitMethods.cs:32:5:35:5 | {...} | ExitMethods.cs:33:9:33:26 | ...; | semmle.label | successor |
| ExitMethods.cs:33:9:33:25 | call to method ApplicationExit | ExitMethods.cs:31:10:31:11 | exit M5 | semmle.label | exit |
| ExitMethods.cs:33:9:33:25 | this access | ExitMethods.cs:33:9:33:25 | call to method ApplicationExit | semmle.label | successor |
| ExitMethods.cs:33:9:33:26 | ...; | ExitMethods.cs:33:9:33:25 | this access | semmle.label | successor |
| ExitMethods.cs:37:10:37:11 | enter M6 | ExitMethods.cs:38:5:51:5 | {...} | semmle.label | successor |
| ExitMethods.cs:38:5:51:5 | {...} | ExitMethods.cs:39:9:50:9 | try {...} ... | semmle.label | successor |
| ExitMethods.cs:39:9:50:9 | try {...} ... | ExitMethods.cs:40:9:42:9 | {...} | semmle.label | successor |
| ExitMethods.cs:40:9:42:9 | {...} | ExitMethods.cs:41:13:41:31 | ...; | semmle.label | successor |
| ExitMethods.cs:41:13:41:30 | call to method ErrorAlways | ExitMethods.cs:43:9:46:9 | [exception: ArgumentException] catch (...) {...} | semmle.label | exception(ArgumentException) |
| ExitMethods.cs:41:13:41:30 | call to method ErrorAlways | ExitMethods.cs:43:9:46:9 | [exception: Exception] catch (...) {...} | semmle.label | exception(Exception) |
| ExitMethods.cs:41:13:41:31 | ...; | ExitMethods.cs:41:25:41:29 | false | semmle.label | successor |
| ExitMethods.cs:41:25:41:29 | false | ExitMethods.cs:41:13:41:30 | call to method ErrorAlways | semmle.label | successor |
| ExitMethods.cs:43:9:46:9 | [exception: ArgumentException] catch (...) {...} | ExitMethods.cs:44:9:46:9 | {...} | semmle.label | match |
| ExitMethods.cs:43:9:46:9 | [exception: Exception] catch (...) {...} | ExitMethods.cs:44:9:46:9 | {...} | semmle.label | match |
| ExitMethods.cs:43:9:46:9 | [exception: Exception] catch (...) {...} | ExitMethods.cs:47:9:50:9 | [exception: Exception] catch (...) {...} | semmle.label | no-match |
| ExitMethods.cs:44:9:46:9 | {...} | ExitMethods.cs:45:13:45:19 | return ...; | semmle.label | successor |
| ExitMethods.cs:45:13:45:19 | return ...; | ExitMethods.cs:37:10:37:11 | exit M6 | semmle.label | return |
| ExitMethods.cs:47:9:50:9 | [exception: Exception] catch (...) {...} | ExitMethods.cs:48:9:50:9 | {...} | semmle.label | match |
| ExitMethods.cs:48:9:50:9 | {...} | ExitMethods.cs:49:13:49:19 | return ...; | semmle.label | successor |
| ExitMethods.cs:49:13:49:19 | return ...; | ExitMethods.cs:37:10:37:11 | exit M6 | semmle.label | return |
| ExitMethods.cs:53:17:53:26 | enter ErrorMaybe | ExitMethods.cs:54:5:57:5 | {...} | semmle.label | successor |
| ExitMethods.cs:54:5:57:5 | {...} | ExitMethods.cs:55:9:56:34 | if (...) ... | semmle.label | successor |
| ExitMethods.cs:55:9:56:34 | if (...) ... | ExitMethods.cs:55:13:55:13 | access to parameter b | semmle.label | successor |
| ExitMethods.cs:55:13:55:13 | access to parameter b | ExitMethods.cs:53:17:53:26 | exit ErrorMaybe | semmle.label | false |
| ExitMethods.cs:55:13:55:13 | access to parameter b | ExitMethods.cs:56:19:56:33 | object creation of type Exception | semmle.label | true |
| ExitMethods.cs:56:13:56:34 | throw ...; | ExitMethods.cs:53:17:53:26 | exit ErrorMaybe | semmle.label | exception(Exception) |
| ExitMethods.cs:56:19:56:33 | object creation of type Exception | ExitMethods.cs:56:13:56:34 | throw ...; | semmle.label | successor |
| ExitMethods.cs:59:17:59:27 | enter ErrorAlways | ExitMethods.cs:60:5:65:5 | {...} | semmle.label | successor |
| ExitMethods.cs:60:5:65:5 | {...} | ExitMethods.cs:61:9:64:45 | if (...) ... | semmle.label | successor |
| ExitMethods.cs:61:9:64:45 | if (...) ... | ExitMethods.cs:61:13:61:13 | access to parameter b | semmle.label | successor |
| ExitMethods.cs:61:13:61:13 | access to parameter b | ExitMethods.cs:62:19:62:33 | object creation of type Exception | semmle.label | true |
| ExitMethods.cs:61:13:61:13 | access to parameter b | ExitMethods.cs:64:41:64:43 | "b" | semmle.label | false |
| ExitMethods.cs:62:13:62:34 | throw ...; | ExitMethods.cs:59:17:59:27 | exit ErrorAlways | semmle.label | exception(Exception) |
| ExitMethods.cs:62:19:62:33 | object creation of type Exception | ExitMethods.cs:62:13:62:34 | throw ...; | semmle.label | successor |
| ExitMethods.cs:64:13:64:45 | throw ...; | ExitMethods.cs:59:17:59:27 | exit ErrorAlways | semmle.label | exception(ArgumentException) |
| ExitMethods.cs:64:19:64:44 | object creation of type ArgumentException | ExitMethods.cs:64:13:64:45 | throw ...; | semmle.label | successor |
| ExitMethods.cs:64:41:64:43 | "b" | ExitMethods.cs:64:19:64:44 | object creation of type ArgumentException | semmle.label | successor |
| ExitMethods.cs:67:10:67:13 | enter Exit | ExitMethods.cs:68:5:70:5 | {...} | semmle.label | successor |
| ExitMethods.cs:68:5:70:5 | {...} | ExitMethods.cs:69:9:69:28 | ...; | semmle.label | successor |
| ExitMethods.cs:69:9:69:27 | call to method Exit | ExitMethods.cs:67:10:67:13 | exit Exit | semmle.label | exit |
| ExitMethods.cs:69:9:69:28 | ...; | ExitMethods.cs:69:26:69:26 | 0 | semmle.label | successor |
| ExitMethods.cs:69:26:69:26 | 0 | ExitMethods.cs:69:9:69:27 | call to method Exit | semmle.label | successor |
| ExitMethods.cs:72:10:72:18 | enter ExitInTry | ExitMethods.cs:73:5:83:5 | {...} | semmle.label | successor |
| ExitMethods.cs:73:5:83:5 | {...} | ExitMethods.cs:74:9:82:9 | try {...} ... | semmle.label | successor |
| ExitMethods.cs:74:9:82:9 | try {...} ... | ExitMethods.cs:75:9:77:9 | {...} | semmle.label | successor |
| ExitMethods.cs:75:9:77:9 | {...} | ExitMethods.cs:76:13:76:19 | ...; | semmle.label | successor |
| ExitMethods.cs:76:13:76:18 | call to method Exit | ExitMethods.cs:72:10:72:18 | exit ExitInTry | semmle.label | exit |
| ExitMethods.cs:76:13:76:18 | this access | ExitMethods.cs:76:13:76:18 | call to method Exit | semmle.label | successor |
| ExitMethods.cs:76:13:76:19 | ...; | ExitMethods.cs:76:13:76:18 | this access | semmle.label | successor |
| ExitMethods.cs:85:10:85:24 | enter ApplicationExit | ExitMethods.cs:86:5:88:5 | {...} | semmle.label | successor |
| ExitMethods.cs:86:5:88:5 | {...} | ExitMethods.cs:87:9:87:48 | ...; | semmle.label | successor |
| ExitMethods.cs:87:9:87:47 | call to method Exit | ExitMethods.cs:85:10:85:24 | exit ApplicationExit | semmle.label | exit |
| ExitMethods.cs:87:9:87:48 | ...; | ExitMethods.cs:87:9:87:47 | call to method Exit | semmle.label | successor |
| ExitMethods.cs:90:13:90:21 | enter ThrowExpr | ExitMethods.cs:91:5:93:5 | {...} | semmle.label | successor |
| ExitMethods.cs:91:5:93:5 | {...} | ExitMethods.cs:92:16:92:76 | ... ? ... : ... | semmle.label | successor |
| ExitMethods.cs:92:9:92:77 | return ...; | ExitMethods.cs:90:13:90:21 | exit ThrowExpr | semmle.label | return |
| ExitMethods.cs:92:16:92:20 | access to parameter input | ExitMethods.cs:92:25:92:25 | 0 | semmle.label | successor |
| ExitMethods.cs:92:16:92:25 | ... != ... | ExitMethods.cs:92:29:92:29 | 1 | semmle.label | true |
| ExitMethods.cs:92:16:92:25 | ... != ... | ExitMethods.cs:92:69:92:75 | "input" | semmle.label | false |
| ExitMethods.cs:92:16:92:76 | ... ? ... : ... | ExitMethods.cs:92:16:92:20 | access to parameter input | semmle.label | successor |
| ExitMethods.cs:92:25:92:25 | 0 | ExitMethods.cs:92:25:92:25 | (...) ... | semmle.label | successor |
| ExitMethods.cs:92:25:92:25 | (...) ... | ExitMethods.cs:92:16:92:25 | ... != ... | semmle.label | successor |
| ExitMethods.cs:92:29:92:29 | 1 | ExitMethods.cs:92:29:92:29 | (...) ... | semmle.label | successor |
| ExitMethods.cs:92:29:92:29 | (...) ... | ExitMethods.cs:92:33:92:37 | access to parameter input | semmle.label | successor |
| ExitMethods.cs:92:29:92:37 | ... / ... | ExitMethods.cs:92:9:92:77 | return ...; | semmle.label | successor |
| ExitMethods.cs:92:33:92:37 | access to parameter input | ExitMethods.cs:92:29:92:37 | ... / ... | semmle.label | successor |
| ExitMethods.cs:92:41:92:76 | throw ... | ExitMethods.cs:90:13:90:21 | exit ThrowExpr | semmle.label | exception(ArgumentException) |
| ExitMethods.cs:92:47:92:76 | object creation of type ArgumentException | ExitMethods.cs:92:41:92:76 | throw ... | semmle.label | successor |
| ExitMethods.cs:92:69:92:75 | "input" | ExitMethods.cs:92:47:92:76 | object creation of type ArgumentException | semmle.label | successor |
| ExitMethods.cs:95:16:95:34 | enter ExtensionMethodCall | ExitMethods.cs:96:5:98:5 | {...} | semmle.label | successor |
| ExitMethods.cs:96:5:98:5 | {...} | ExitMethods.cs:97:16:97:38 | ... ? ... : ... | semmle.label | successor |
| ExitMethods.cs:97:9:97:39 | return ...; | ExitMethods.cs:95:16:95:34 | exit ExtensionMethodCall | semmle.label | return |
| ExitMethods.cs:97:16:97:16 | access to parameter s | ExitMethods.cs:97:27:97:29 | - | semmle.label | successor |
| ExitMethods.cs:97:16:97:30 | call to method Contains | ExitMethods.cs:97:34:97:34 | 0 | semmle.label | true |
| ExitMethods.cs:97:16:97:30 | call to method Contains | ExitMethods.cs:97:38:97:38 | 1 | semmle.label | false |
| ExitMethods.cs:97:16:97:38 | ... ? ... : ... | ExitMethods.cs:97:16:97:16 | access to parameter s | semmle.label | successor |
| ExitMethods.cs:97:27:97:29 | - | ExitMethods.cs:97:16:97:30 | call to method Contains | semmle.label | successor |
| ExitMethods.cs:97:34:97:34 | 0 | ExitMethods.cs:97:9:97:39 | return ...; | semmle.label | successor |
| ExitMethods.cs:97:38:97:38 | 1 | ExitMethods.cs:97:9:97:39 | return ...; | semmle.label | successor |
| ExitMethods.cs:100:17:100:32 | enter FailingAssertion | ExitMethods.cs:101:5:104:5 | {...} | semmle.label | successor |
| ExitMethods.cs:101:5:104:5 | {...} | ExitMethods.cs:102:9:102:29 | ...; | semmle.label | successor |
| ExitMethods.cs:102:9:102:28 | call to method IsTrue | ExitMethods.cs:100:17:100:32 | exit FailingAssertion | semmle.label | exception(AssertFailedException) |
| ExitMethods.cs:102:9:102:29 | ...; | ExitMethods.cs:102:23:102:27 | false | semmle.label | successor |
| ExitMethods.cs:102:23:102:27 | false | ExitMethods.cs:102:9:102:28 | call to method IsTrue | semmle.label | successor |
| ExitMethods.cs:106:17:106:33 | enter FailingAssertion2 | ExitMethods.cs:107:5:110:5 | {...} | semmle.label | successor |
| ExitMethods.cs:107:5:110:5 | {...} | ExitMethods.cs:108:9:108:27 | ...; | semmle.label | successor |
| ExitMethods.cs:108:9:108:26 | call to method FailingAssertion | ExitMethods.cs:106:17:106:33 | exit FailingAssertion2 | semmle.label | exception(AssertFailedException) |
| ExitMethods.cs:108:9:108:26 | this access | ExitMethods.cs:108:9:108:26 | call to method FailingAssertion | semmle.label | successor |
| ExitMethods.cs:108:9:108:27 | ...; | ExitMethods.cs:108:9:108:26 | this access | semmle.label | successor |
| ExitMethods.cs:112:10:112:20 | enter AssertFalse | ExitMethods.cs:112:48:112:48 | access to parameter b | semmle.label | successor |
| ExitMethods.cs:112:33:112:49 | call to method IsFalse | ExitMethods.cs:112:10:112:20 | exit AssertFalse | semmle.label | successor |
| ExitMethods.cs:112:48:112:48 | access to parameter b | ExitMethods.cs:112:33:112:49 | call to method IsFalse | semmle.label | successor |
| ExitMethods.cs:114:17:114:33 | enter FailingAssertion3 | ExitMethods.cs:115:5:118:5 | {...} | semmle.label | successor |
| ExitMethods.cs:115:5:118:5 | {...} | ExitMethods.cs:116:9:116:26 | ...; | semmle.label | successor |
| ExitMethods.cs:116:9:116:25 | call to method AssertFalse | ExitMethods.cs:114:17:114:33 | exit FailingAssertion3 | semmle.label | exception(AssertFailedException) |
| ExitMethods.cs:116:9:116:25 | this access | ExitMethods.cs:116:21:116:24 | true | semmle.label | successor |
| ExitMethods.cs:116:9:116:26 | ...; | ExitMethods.cs:116:9:116:25 | this access | semmle.label | successor |
| ExitMethods.cs:116:21:116:24 | true | ExitMethods.cs:116:9:116:25 | call to method AssertFalse | semmle.label | successor |
| Extensions.cs:5:23:5:29 | enter ToInt32 | Extensions.cs:6:5:8:5 | {...} | semmle.label | successor |
| Extensions.cs:6:5:8:5 | {...} | Extensions.cs:7:28:7:28 | access to parameter s | semmle.label | successor |
| Extensions.cs:7:9:7:30 | return ...; | Extensions.cs:5:23:5:29 | exit ToInt32 | semmle.label | return |

View File

@@ -1,6 +1,7 @@
import csharp
import Common
query predicate edges(ControlFlow::Node node, ControlFlow::Node successor, string attr, string val) {
query predicate edges(SourceControlFlowNode node, SourceControlFlowNode successor, string attr, string val) {
exists(ControlFlow::SuccessorType t |
successor = node.getASuccessorByType(t) |
attr = "semmle.label" and

View File

@@ -1,19 +1,6 @@
using System;
using System.Collections.Generic;
namespace Microsoft.VisualStudio.TestTools.UnitTesting
{
class TestClassAttribute : Attribute
{
public TestClassAttribute() { }
}
class TestMethodAttribute : Attribute
{
public TestMethodAttribute() { }
}
}
namespace VisualStudioTests
{
class TestMethodAttribute : Attribute { } // fake
@@ -37,3 +24,5 @@ namespace VisualStudioTests
}
}
}
// semmle-extractor-options: ${testdir}/../../../resources/stubs/Microsoft.VisualStudio.TestTools.UnitTesting.cs

View File

@@ -1,8 +1,8 @@
| VisualStudio.cs:22:11:22:21 | MyTestSuite | TestClass | VSTestClass |
| VisualStudio.cs:25:21:25:25 | Test1 | TestMethod | InstanceCallable |
| VisualStudio.cs:25:21:25:25 | Test1 | TestMethod | VSTestMethod |
| VisualStudio.cs:30:21:30:25 | Test2 | TestMethod | InstanceCallable |
| VisualStudio.cs:30:21:30:25 | Test2 | TestMethod | VSTestMethod |
| VisualStudio.cs:9:11:9:21 | MyTestSuite | TestClass | VSTestClass |
| VisualStudio.cs:12:21:12:25 | Test1 | TestMethod | InstanceCallable |
| VisualStudio.cs:12:21:12:25 | Test1 | TestMethod | VSTestMethod |
| VisualStudio.cs:17:21:17:25 | Test2 | TestMethod | InstanceCallable |
| VisualStudio.cs:17:21:17:25 | Test2 | TestMethod | VSTestMethod |
| XUnit.cs:22:11:22:21 | MyTestSuite | TestClass | XUnitTestClass |
| XUnit.cs:25:21:25:25 | Test1 | TestMethod | InstanceCallable |
| XUnit.cs:25:21:25:25 | Test1 | TestMethod | XUnitTestMethod |

View File

@@ -1,19 +1,6 @@
using System;
using System.Collections.Generic;
namespace Microsoft.VisualStudio.TestTools.UnitTesting
{
class TestClassAttribute : Attribute
{
public TestClassAttribute() { }
}
class TestMethodAttribute : Attribute
{
public TestMethodAttribute() { }
}
}
namespace VisualStudioTests
{
class TestMethodAttribute : Attribute { } // fake
@@ -37,3 +24,5 @@ namespace VisualStudioTests
}
}
}
// semmle-extractor-options: ${testdir}/../../../resources/stubs/Microsoft.VisualStudio.TestTools.UnitTesting.cs

View File

@@ -56,4 +56,9 @@ class LocalScopeVariableShadowsMember
public void M5(int f2) { } // GOOD
}
class C4 : C
{
public C4(int f) { } // GOOD
}
}

View File

@@ -86,19 +86,6 @@ public struct S
class C { } // not dead
}
namespace Microsoft.VisualStudio.TestTools.UnitTesting
{
class TestClassAttribute : Attribute
{
public TestClassAttribute() { }
}
class TestInitializeAttribute : Attribute
{
public TestInitializeAttribute() { }
}
}
[Microsoft.VisualStudio.TestTools.UnitTesting.TestClass]
public class VisualStudioTests
{
@@ -106,4 +93,4 @@ public class VisualStudioTests
public void Setup() { } // not dead
}
// semmle-extractor-options: /r:System.Dynamic.Runtime.dll /r:System.Linq.Expressions.dll
// semmle-extractor-options: /r:System.Dynamic.Runtime.dll /r:System.Linq.Expressions.dll ${testdir}/../../../resources/stubs/Microsoft.VisualStudio.TestTools.UnitTesting.cs

View File

@@ -2,17 +2,6 @@ using System;
using System.Diagnostics;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Microsoft.VisualStudio.TestTools.UnitTesting
{
public static class Assert
{
public static void IsNull(object o) { }
public static void IsNotNull(object o) { }
public static void IsTrue(bool b) { }
public static void IsFalse(bool b) { }
}
}
class AssertTests
{
void Fn()
@@ -40,3 +29,5 @@ class AssertTests
Console.WriteLine(s.Length);
}
}
// semmle-extractor-options: ${testdir}/../../resources/stubs/Microsoft.VisualStudio.TestTools.UnitTesting.cs

View File

@@ -12,6 +12,6 @@
| A.cs:194:27:194:36 | access to local variable methodcall | Variable $@ is always null here. | A.cs:189:16:189:25 | methodcall | methodcall |
| A.cs:247:31:247:44 | access to local variable eq_call_always | Variable $@ is always null here. | A.cs:241:11:241:24 | eq_call_always | eq_call_always |
| A.cs:258:31:258:45 | access to local variable neq_call_always | Variable $@ is always null here. | A.cs:244:11:244:25 | neq_call_always | neq_call_always |
| Assert.cs:25:27:25:27 | access to local variable s | Variable $@ is always null here. | Assert.cs:20:16:20:16 | s | s |
| Assert.cs:31:27:31:27 | access to local variable s | Variable $@ is always null here. | Assert.cs:20:16:20:16 | s | s |
| Assert.cs:37:27:37:27 | access to local variable s | Variable $@ is always null here. | Assert.cs:20:16:20:16 | s | s |
| Assert.cs:14:27:14:27 | access to local variable s | Variable $@ is always null here. | Assert.cs:9:16:9:16 | s | s |
| Assert.cs:20:27:20:27 | access to local variable s | Variable $@ is always null here. | Assert.cs:9:16:9:16 | s | s |
| Assert.cs:26:27:26:27 | access to local variable s | Variable $@ is always null here. | Assert.cs:9:16:9:16 | s | s |

View File

@@ -2,19 +2,6 @@ using System;
using System.Security.Cryptography;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Microsoft.VisualStudio.TestTools.UnitTesting
{
class TestClassAttribute : Attribute
{
public TestClassAttribute() { }
}
class TestMethodAttribute : Attribute
{
public TestMethodAttribute() { }
}
}
[TestClass]
public class InsecureRandomnessTest
{
@@ -26,3 +13,5 @@ public class InsecureRandomnessTest
Random r = new Random();
}
}
// semmle-extractor-options: ${testdir}/../../../resources/stubs/Microsoft.VisualStudio.TestTools.UnitTesting.cs

View File

@@ -5,4 +5,4 @@
| HardcodedCredentials.cs:53:13:53:24 | "myPa55word" | The hard-coded value "myPa55word" flows to the $@ parameter in $@. | HardcodedCredentials.cs:53:13:53:24 | "myPa55word" | password | HardcodedCredentials.cs:51:33:53:25 | object creation of type X509Certificate2 | object creation of type X509Certificate2 |
| HardcodedCredentials.cs:76:31:76:42 | "myusername" | The hard-coded value "myusername" flows to the $@ parameter in $@. | HardcodedCredentials.cs:76:31:76:42 | "myusername" | username | HardcodedCredentials.cs:76:9:76:57 | call to method CreateUser | call to method CreateUser |
| HardcodedCredentials.cs:76:45:76:56 | "mypassword" | The hard-coded value "mypassword" flows to the $@ parameter in $@. | HardcodedCredentials.cs:76:45:76:56 | "mypassword" | password | HardcodedCredentials.cs:76:9:76:57 | call to method CreateUser | call to method CreateUser |
| TestHardcodedCredentials.cs:39:19:39:28 | "username" | The hard-coded value "username" flows to the $@ parameter in $@. | TestHardcodedCredentials.cs:39:19:39:28 | "username" | name | TestHardcodedCredentials.cs:37:31:51:13 | object creation of type MembershipUser | object creation of type MembershipUser |
| TestHardcodedCredentials.cs:26:19:26:28 | "username" | The hard-coded value "username" flows to the $@ parameter in $@. | TestHardcodedCredentials.cs:26:19:26:28 | "username" | name | TestHardcodedCredentials.cs:24:31:38:13 | object creation of type MembershipUser | object creation of type MembershipUser |

View File

@@ -2,19 +2,6 @@ using System;
using System.Web.Security;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Microsoft.VisualStudio.TestTools.UnitTesting
{
class TestClassAttribute : Attribute
{
public TestClassAttribute() { }
}
class TestMethodAttribute : Attribute
{
public TestMethodAttribute() { }
}
}
namespace Moq.Language
{
class TestReturn
@@ -69,3 +56,5 @@ public class HardCodedCredentialsTest
Moq.Language.TestReturn.Returns(() => mockUser);
}
}
// semmle-extractor-options: ${testdir}/../../../resources/stubs/Microsoft.VisualStudio.TestTools.UnitTesting.cs

View File

@@ -0,0 +1,29 @@
using System;
namespace Microsoft.VisualStudio.TestTools.UnitTesting
{
public static class Assert
{
public static void IsNull(object o) { }
public static void IsNotNull(object o) { }
public static void IsTrue(bool b) { }
public static void IsFalse(bool b) { }
}
public class AssertFailedException : Exception { }
public class TestClassAttribute : Attribute
{
public TestClassAttribute() { }
}
public class TestMethodAttribute : Attribute
{
public TestMethodAttribute() { }
}
public class TestInitializeAttribute : Attribute
{
public TestInitializeAttribute() { }
}
}

View File

@@ -10,4 +10,9 @@ namespace System.Windows.Forms
{
public static void Show(string msg,string title) { }
}
public class Application
{
public static void Exit() { }
}
}

View File

@@ -13,6 +13,7 @@
import java
import semmle.code.java.dataflow.SSA
import semmle.code.java.dataflow.RangeUtils
import semmle.code.java.dataflow.RangeAnalysis
/**
@@ -31,9 +32,7 @@ predicate boundedArrayAccess(ArrayAccess aa, int k) {
k = delta
)
or
exists(ArrayCreationExpr arraycreation |
arraycreation = arr.(SsaExplicitUpdate).getDefiningExpr().(VariableAssign).getSource()
|
exists(ArrayCreationExpr arraycreation | arraycreation = getArrayDef(arr) |
k = delta and
arraycreation.getDimension(0) = b.getExpr()
or

View File

@@ -4,6 +4,9 @@ import semmle.code.java.Expr
import semmle.code.java.dataflow.FlowSources
import semmle.code.java.frameworks.android.SQLite
import semmle.code.java.frameworks.javaee.Persistence
import semmle.code.java.frameworks.SpringJdbc
import semmle.code.java.frameworks.MyBatis
import semmle.code.java.frameworks.Hibernate
/** A sink for database query language injection vulnerabilities. */
abstract class QueryInjectionSink extends DataFlow::ExprNode { }
@@ -13,8 +16,19 @@ class SqlInjectionSink extends QueryInjectionSink {
SqlInjectionSink() {
this.getExpr() instanceof SqlExpr
or
exists(SQLiteRunner s, MethodAccess m | m.getMethod() = s |
m.getArgument(s.sqlIndex()) = this.getExpr()
exists(MethodAccess ma, Method m, int index |
ma.getMethod() = m and
ma.getArgument(index) = this.getExpr()
|
index = m.(SQLiteRunner).sqlIndex()
or
m instanceof BatchUpdateVarargsMethod
or
index = 0 and jdbcSqlMethod(m)
or
index = 0 and mybatisSqlMethod(m)
or
index = 0 and hibernateSqlMethod(m)
)
}
}

View File

@@ -32,6 +32,7 @@ class HeaderSplittingSink extends DataFlow::ExprNode {
class WhitelistedSource extends RemoteUserInput {
WhitelistedSource() {
this.asExpr().(MethodAccess).getMethod() instanceof HttpServletRequestGetHeaderMethod
this.asExpr().(MethodAccess).getMethod() instanceof HttpServletRequestGetHeaderMethod or
this.asExpr().(MethodAccess).getMethod() instanceof CookieGetNameMethod
}
}

View File

@@ -0,0 +1,10 @@
String s = ...;
int n;
n = Integer.parseInt(s); // BAD: NumberFormatException is not caught.
try {
n = Integer.parseInt(s);
} catch (NumberFormatException e) { // GOOD: The exception is caught.
// Handle the exception
}

View File

@@ -0,0 +1,43 @@
<!DOCTYPE qhelp PUBLIC
"-//Semmle//qhelp//EN"
"qhelp.dtd">
<qhelp>
<overview>
<p>Methods such as <code>Integer.parseInt</code> that parse strings into numbers
throw
<code>NumberFormatException</code> if their arguments cannot be parsed.
This exception should be caught so that any parse errors can be handled.
</p>
</overview>
<recommendation>
<p>It is usually best to handle <code>NumberFormatException</code> in a <code>catch</code> clause
surrounding the call to the parsing method.</p>
</recommendation>
<example>
<p>In the following example, the first call to <code>Integer.parseInt</code> does not catch the exception.
The second call does.
</p>
<sample src="NumberFormatException.java" />
</example>
<references>
<li>
Java Platform, Standard Edition 8, API Specification:
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html#valueOf-java.lang.String-">Integer.valueOf</a>,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html#parseInt-java.lang.String-">Integer.parseInt</a>,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html#parseLong-java.lang.String-">Long.parseLong</a>,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NumberFormatException.html">NumberFormatException</a>.
</li>
</references>
</qhelp>

View File

@@ -0,0 +1,91 @@
/**
* @name Missing catch of NumberFormatException
* @description Calling a string to number conversion method without handling
* 'NumberFormatException' may cause unexpected runtime exceptions.
* @kind problem
* @problem.severity recommendation
* @precision high
* @id java/uncaught-number-format-exception
* @tags reliability
* external/cwe/cwe-248
*/
import java
private class SpecialMethodAccess extends MethodAccess {
predicate isValueOfMethod(string klass) {
this.getMethod().getName() = "valueOf" and
this.getQualifier().getType().(RefType).hasQualifiedName("java.lang", klass) and
this.getAnArgument().getType().(RefType).hasQualifiedName("java.lang", "String")
}
predicate isParseMethod(string klass, string name) {
this.getMethod().getName() = name and
this.getQualifier().getType().(RefType).hasQualifiedName("java.lang", klass)
}
predicate throwsNFE() {
this.isParseMethod("Byte", "parseByte") or
this.isParseMethod("Short", "parseShort") or
this.isParseMethod("Integer", "parseInt") or
this.isParseMethod("Long", "parseLong") or
this.isParseMethod("Float", "parseFloat") or
this.isParseMethod("Double", "parseDouble") or
this.isParseMethod("Byte", "decode") or
this.isParseMethod("Short", "decode") or
this.isParseMethod("Integer", "decode") or
this.isParseMethod("Long", "decode") or
this.isValueOfMethod("Byte") or
this.isValueOfMethod("Short") or
this.isValueOfMethod("Integer") or
this.isValueOfMethod("Long") or
this.isValueOfMethod("Float") or
this.isValueOfMethod("Double")
}
}
private class SpecialClassInstanceExpr extends ClassInstanceExpr {
predicate isStringConstructor(string klass) {
this.getType().(RefType).hasQualifiedName("java.lang", klass) and
this.getAnArgument().getType().(RefType).hasQualifiedName("java.lang", "String") and
this.getNumArgument() = 1
}
predicate throwsNFE() {
this.isStringConstructor("Byte") or
this.isStringConstructor("Short") or
this.isStringConstructor("Integer") or
this.isStringConstructor("Long") or
this.isStringConstructor("Float") or
this.isStringConstructor("Double")
}
}
class NumberFormatException extends RefType {
NumberFormatException() { this.hasQualifiedName("java.lang", "NumberFormatException") }
}
private predicate catchesNFE(TryStmt t) {
exists(CatchClause cc, LocalVariableDeclExpr v |
t.getACatchClause() = cc and
cc.getVariable() = v and
v.getType().(RefType).getASubtype*() instanceof NumberFormatException
)
}
private predicate throwsNFE(Expr e) {
e.(SpecialClassInstanceExpr).throwsNFE() or e.(SpecialMethodAccess).throwsNFE()
}
from Expr e
where
throwsNFE(e) and
not exists(TryStmt t |
t.getBlock() = e.getEnclosingStmt().getParent*() and
catchesNFE(t)
) and
not exists(Callable c |
e.getEnclosingCallable() = c and
c.getAThrownExceptionType().getASubtype*() instanceof NumberFormatException
)
select e, "Potential uncaught 'java.lang.NumberFormatException'."

View File

@@ -16,6 +16,7 @@ import semmle.code.java.frameworks.android.XmlParsing
import semmle.code.java.frameworks.android.WebView
import semmle.code.java.frameworks.JaxWS
import semmle.code.java.frameworks.android.Intent
import semmle.code.java.frameworks.SpringWeb
/** Class for `tainted` user input. */
abstract class UserInput extends DataFlow::Node { }
@@ -66,6 +67,8 @@ class RemoteUserInput extends UserInput {
m.getParameter(4) = this.asParameter() or
m.getParameter(5) = this.asParameter()
)
or
this.asParameter().getAnAnnotation() instanceof SpringServletInputAnnotation
}
/**

View File

@@ -583,18 +583,6 @@ private predicate unequalSsa(SsaVariable v, SsaReadPosition pos, Bound b, int de
)
}
/**
* Holds if `inp` is an input to `phi` along a back edge.
*/
private predicate backEdge(SsaPhiNode phi, SsaVariable inp, SsaReadPositionPhiInputEdge edge) {
edge.phiInput(phi, inp) and
// Conservatively assume that every edge is a back edge if we don't have dominance information.
(
phi.getBasicBlock().bbDominates(edge.getOrigBlock()) or
not hasDominanceInformation(edge.getOrigBlock())
)
}
/** Weakens a delta to lie in the range `[-1..1]`. */
bindingset[delta, upper]
private int weakenDelta(boolean upper, int delta) {

View File

@@ -6,6 +6,65 @@ import java
private import SSA
private import semmle.code.java.controlflow.internal.GuardsLogic
/**
* Holds if `v` is an input to `phi` that is not along a back edge, and the
* only other input to `phi` is a `null` value.
*
* Note that the declared type of `phi` is `SsaVariable` instead of
* `SsaPhiNode` in order for the reflexive case of `nonNullSsaFwdStep*(..)` to
* have non-`SsaPhiNode` results.
*/
private predicate nonNullSsaFwdStep(SsaVariable v, SsaVariable phi) {
exists(SsaExplicitUpdate vnull, SsaPhiNode phi0 | phi0 = phi |
2 = strictcount(phi0.getAPhiInput()) and
vnull = phi0.getAPhiInput() and
v = phi0.getAPhiInput() and
not backEdge(phi0, v, _) and
vnull != v and
vnull.getDefiningExpr().(VariableAssign).getSource() instanceof NullLiteral
)
}
private predicate nonNullDefStep(Expr e1, Expr e2) {
e2.(ParExpr).getExpr() = e1
or
exists(ConditionalExpr cond | cond = e2 |
cond.getTrueExpr() = e1 and cond.getFalseExpr() instanceof NullLiteral
or
cond.getFalseExpr() = e1 and cond.getTrueExpr() instanceof NullLiteral
)
}
/**
* Gets the definition of `v` provided that `v` is a non-null array with an
* explicit `ArrayCreationExpr` definition and that the definition does not go
* through a back edge.
*/
ArrayCreationExpr getArrayDef(SsaVariable v) {
exists(Expr src |
v.(SsaExplicitUpdate).getDefiningExpr().(VariableAssign).getSource() = src and
nonNullDefStep*(result, src)
)
or
exists(SsaVariable mid |
result = getArrayDef(mid) and
nonNullSsaFwdStep(mid, v)
)
}
/**
* Holds if `arrlen` is a read of an array `length` field on an array that, if
* it is non-null, is defined by `def` and that the definition can reach
* `arrlen` without going through a back edge.
*/
private predicate arrayLengthDef(FieldRead arrlen, ArrayCreationExpr def) {
exists(SsaVariable arr |
arrlen.getField() instanceof ArrayLengthField and
arrlen.getQualifier() = arr.getAUse() and
def = getArrayDef(arr)
)
}
/** An expression that always has the same integer value. */
pragma[nomagic]
private predicate constantIntegerExpr(Expr e, int val) {
@@ -17,11 +76,17 @@ private predicate constantIntegerExpr(Expr e, int val) {
constantIntegerExpr(src, val)
)
or
exists(SsaExplicitUpdate v, FieldRead arrlen |
e = arrlen and
exists(ArrayCreationExpr a |
arrayLengthDef(e, a) and
a.getFirstDimensionSize() = val
)
or
exists(Field a, FieldRead arrlen |
a.isFinal() and
a.getInitializer().(ArrayCreationExpr).getFirstDimensionSize() = val and
arrlen.getField() instanceof ArrayLengthField and
arrlen.getQualifier() = v.getAUse() and
v.getDefiningExpr().(VariableAssign).getSource().(ArrayCreationExpr).getFirstDimensionSize() = val
arrlen.getQualifier() = a.getAnAccess() and
e = arrlen
)
}
@@ -122,6 +187,18 @@ class SsaReadPositionPhiInputEdge extends SsaReadPosition, TSsaReadPositionPhiIn
override string toString() { result = "edge" }
}
/**
* Holds if `inp` is an input to `phi` along a back edge.
*/
predicate backEdge(SsaPhiNode phi, SsaVariable inp, SsaReadPositionPhiInputEdge edge) {
edge.phiInput(phi, inp) and
// Conservatively assume that every edge is a back edge if we don't have dominance information.
(
phi.getBasicBlock().bbDominates(edge.getOrigBlock()) or
not hasDominanceInformation(edge.getOrigBlock())
)
}
/**
* Holds if `guard` directly controls the position `controlled` with the
* value `testIsTrue`.
@@ -201,11 +278,9 @@ predicate valueFlowStep(Expr e2, Expr e1, int delta) {
or
e2.(PreDecExpr).getExpr() = e1 and delta = -1
or
exists(SsaExplicitUpdate v, FieldRead arrlen |
e2 = arrlen and
arrlen.getField() instanceof ArrayLengthField and
arrlen.getQualifier() = v.getAUse() and
v.getDefiningExpr().(VariableAssign).getSource().(ArrayCreationExpr).getDimension(0) = e1 and
exists(ArrayCreationExpr a |
arrayLengthDef(e2, a) and
a.getDimension(0) = e1 and
delta = 0
)
or

View File

@@ -0,0 +1,23 @@
/**
* Provides classes and predicates for working with the Hibernate framework.
*/
import java
/** The interface `org.hibernate.Session`. */
class HibernateSession extends RefType {
HibernateSession() { this.hasQualifiedName("org.hibernate", "Session") }
}
/**
* Holds if `m` is a method on `HibernateSession` taking an SQL string as its
* first argument.
*/
predicate hibernateSqlMethod(Method m) {
m.getDeclaringType() instanceof HibernateSession and
m.getParameterType(0) instanceof TypeString and
(
m.hasName("createQuery") or
m.hasName("createSQLQuery")
)
}

View File

@@ -0,0 +1,27 @@
/**
* Provides classes and predicates for working with the MyBatis framework.
*/
import java
/** The class `org.apache.ibatis.jdbc.SqlRunner`. */
class MyBatisSqlRunner extends RefType {
MyBatisSqlRunner() { this.hasQualifiedName("org.apache.ibatis.jdbc", "SqlRunner") }
}
/**
* Holds if `m` is a method on `MyBatisSqlRunner` taking an SQL string as its
* first argument.
*/
predicate mybatisSqlMethod(Method m) {
m.getDeclaringType() instanceof MyBatisSqlRunner and
m.getParameterType(0) instanceof TypeString and
(
m.hasName("delete") or
m.hasName("insert") or
m.hasName("run") or
m.hasName("selectAll") or
m.hasName("selectOne") or
m.hasName("update")
)
}

View File

@@ -0,0 +1,35 @@
/**
* Provides classes and predicates for working with the Spring JDBC framework.
*/
import java
/** The class `org.springframework.jdbc.core.JdbcTemplate`. */
class JdbcTemplate extends RefType {
JdbcTemplate() { this.hasQualifiedName("org.springframework.jdbc.core", "JdbcTemplate") }
}
/**
* Holds if `m` is a method on `JdbcTemplate` taking an SQL string as its first
* argument.
*/
predicate jdbcSqlMethod(Method m) {
m.getDeclaringType() instanceof JdbcTemplate and
m.getParameterType(0) instanceof TypeString and
(
m.hasName("batchUpdate") or
m.hasName("execute") or
m.getName().matches("query%") or
m.hasName("update")
)
}
/** The method `JdbcTemplate.batchUpdate(String... sql)` */
class BatchUpdateVarargsMethod extends Method {
BatchUpdateVarargsMethod() {
this.getDeclaringType() instanceof JdbcTemplate and
this.hasName("batchUpdate") and
this.getParameterType(0).(Array).getComponentType() instanceof TypeString and
this.getParameter(0).isVarargs()
}
}

View File

@@ -0,0 +1,17 @@
import java
/** A Spring framework annotation indicating remote user input from servlets. */
class SpringServletInputAnnotation extends Annotation {
SpringServletInputAnnotation() {
exists(AnnotationType a |
a = this.getType() and
a.getPackage().getName() = "org.springframework.web.bind.annotation"
|
a.hasName("MatrixVariable") or
a.hasName("RequestParam") or
a.hasName("RequestHeader") or
a.hasName("CookieValue") or
a.hasName("RequestPart")
)
}
}

View File

@@ -0,0 +1,30 @@
| Test.java:11:9:11:29 | parseByte(...) | Potential uncaught 'java.lang.NumberFormatException'. |
| Test.java:12:9:12:26 | decode(...) | Potential uncaught 'java.lang.NumberFormatException'. |
| Test.java:13:9:13:27 | valueOf(...) | Potential uncaught 'java.lang.NumberFormatException'. |
| Test.java:14:9:14:31 | valueOf(...) | Potential uncaught 'java.lang.NumberFormatException'. |
| Test.java:15:9:15:30 | valueOf(...) | Potential uncaught 'java.lang.NumberFormatException'. |
| Test.java:16:9:16:23 | new Byte(...) | Potential uncaught 'java.lang.NumberFormatException'. |
| Test.java:19:9:19:31 | parseShort(...) | Potential uncaught 'java.lang.NumberFormatException'. |
| Test.java:20:9:20:27 | decode(...) | Potential uncaught 'java.lang.NumberFormatException'. |
| Test.java:21:9:21:28 | valueOf(...) | Potential uncaught 'java.lang.NumberFormatException'. |
| Test.java:22:9:22:32 | valueOf(...) | Potential uncaught 'java.lang.NumberFormatException'. |
| Test.java:23:9:23:33 | valueOf(...) | Potential uncaught 'java.lang.NumberFormatException'. |
| Test.java:24:9:24:24 | new Short(...) | Potential uncaught 'java.lang.NumberFormatException'. |
| Test.java:27:9:27:31 | parseInt(...) | Potential uncaught 'java.lang.NumberFormatException'. |
| Test.java:28:9:28:29 | decode(...) | Potential uncaught 'java.lang.NumberFormatException'. |
| Test.java:29:9:29:30 | valueOf(...) | Potential uncaught 'java.lang.NumberFormatException'. |
| Test.java:30:9:30:34 | valueOf(...) | Potential uncaught 'java.lang.NumberFormatException'. |
| Test.java:31:9:31:39 | valueOf(...) | Potential uncaught 'java.lang.NumberFormatException'. |
| Test.java:32:9:32:26 | new Integer(...) | Potential uncaught 'java.lang.NumberFormatException'. |
| Test.java:35:9:35:29 | parseLong(...) | Potential uncaught 'java.lang.NumberFormatException'. |
| Test.java:36:9:36:26 | decode(...) | Potential uncaught 'java.lang.NumberFormatException'. |
| Test.java:37:9:37:27 | valueOf(...) | Potential uncaught 'java.lang.NumberFormatException'. |
| Test.java:38:9:38:31 | valueOf(...) | Potential uncaught 'java.lang.NumberFormatException'. |
| Test.java:39:9:39:36 | valueOf(...) | Potential uncaught 'java.lang.NumberFormatException'. |
| Test.java:40:9:40:23 | new Long(...) | Potential uncaught 'java.lang.NumberFormatException'. |
| Test.java:43:9:43:40 | parseFloat(...) | Potential uncaught 'java.lang.NumberFormatException'. |
| Test.java:44:9:44:37 | valueOf(...) | Potential uncaught 'java.lang.NumberFormatException'. |
| Test.java:45:9:45:33 | new Float(...) | Potential uncaught 'java.lang.NumberFormatException'. |
| Test.java:48:9:48:42 | parseDouble(...) | Potential uncaught 'java.lang.NumberFormatException'. |
| Test.java:49:9:49:38 | valueOf(...) | Potential uncaught 'java.lang.NumberFormatException'. |
| Test.java:50:9:50:34 | new Double(...) | Potential uncaught 'java.lang.NumberFormatException'. |

View File

@@ -0,0 +1 @@
Violations of Best Practice/Exception Handling/NumberFormatException.ql

View File

@@ -0,0 +1,136 @@
import java.io.*;
public class Test {
public static void main(String[] args) {
test1();
test2();
test3();
}
static void test1() {
Byte.parseByte("123");
Byte.decode("123");
Byte.valueOf("123");
Byte.valueOf("123", 10);
Byte.valueOf("7f", 16);
new Byte("123");
new Byte((byte) 123); // don't flag: wrong constructor
Short.parseShort("123");
Short.decode("123");
Short.valueOf("123");
Short.valueOf("123", 10);
Short.valueOf("7abc", 16);
new Short("123");
new Short((short) 123); // don't flag: wrong constructor
Integer.parseInt("123");
Integer.decode("123");
Integer.valueOf("123");
Integer.valueOf("123", 10);
Integer.valueOf("1234beef", 16);
new Integer("123");
new Integer(123); // don't flag: wrong constructor
Long.parseLong("123");
Long.decode("123");
Long.valueOf("123");
Long.valueOf("123", 10);
Long.valueOf("deadbeef", 16);
new Long("123");
new Long(123l); // don't flag: wrong constructor
Float.parseFloat("2.7818281828");
Float.valueOf("2.7818281828");
new Float("2.7818281828");
new Float(2.7818281828f); // don't flag: wrong constructor
Double.parseDouble("2.7818281828");
Double.valueOf("2.7818281828");
new Double("2.7818281828");
new Double(2.7818281828); // don't flag: wrong constructor
}
static void test2() {
// Don't flag any of these. The exception is caught.
try {
Byte.parseByte("123");
Byte.decode("123");
Byte.valueOf("123");
Byte.valueOf("123", 10);
Byte.valueOf("7f", 16);
new Byte("123");
Short.parseShort("123");
Short.decode("123");
Short.valueOf("123");
Short.valueOf("123", 10);
Short.valueOf("7abc", 16);
new Short("123");
Integer.parseInt("123");
Integer.decode("123");
Integer.valueOf("123");
Integer.valueOf("123", 10);
Integer.valueOf("1234beef", 16);
new Integer("123");
Long.parseLong("123");
Long.decode("123");
Long.valueOf("123");
Long.valueOf("123", 10);
Long.valueOf("deadbeef", 16);
new Long("123");
Float.parseFloat("2.7818281828");
Float.valueOf("2.7818281828");
new Float("2.7818281828");
Double.parseDouble("2.7818281828");
Double.valueOf("2.7818281828");
new Double("2.7818281828");
}
catch (NumberFormatException e) {
// parse error
}
}
static void test3() throws NumberFormatException {
// Don't flag any of these: the exception is explcitly declared
Byte.parseByte("123");
Byte.decode("123");
Byte.valueOf("123");
Byte.valueOf("123", 10);
Byte.valueOf("7f", 16);
new Byte("123");
Short.parseShort("123");
Short.decode("123");
Short.valueOf("123");
Short.valueOf("123", 10);
Short.valueOf("7abc", 16);
new Short("123");
Integer.parseInt("123");
Integer.decode("123");
Integer.valueOf("123");
Integer.valueOf("123", 10);
Integer.valueOf("1234beef", 16);
new Integer("123");
Long.parseLong("123");
Long.decode("123");
Long.valueOf("123");
Long.valueOf("123", 10);
Long.valueOf("deadbeef", 16);
new Long("123");
Float.parseFloat("2.7818281828");
Float.valueOf("2.7818281828");
new Float("2.7818281828");
Double.parseDouble("2.7818281828");
Double.valueOf("2.7818281828");
new Double("2.7818281828");
}
}

View File

@@ -34,7 +34,7 @@ public class A {
}
for (int i = 0; i < arr1.length; ) {
sum += arr1[i++]; // OK
sum += arr1[i++]; // OK - FP
sum += arr1[i++]; // OK
i += 2;
}
for (int i = 0; i < arr2.length; ) {
@@ -162,4 +162,17 @@ public class A {
sum += b[i] + b[i + 1]; // OK
}
}
void m13(int n) {
int[] a = null;
if (n > 0) {
a = n > 0 ? new int[3 * n] : null;
}
int sum;
if (a != null) {
for (int i = 0; i < a.length; i += 3) {
sum += a[i + 2]; // OK
}
}
}
}

View File

@@ -1,6 +1,5 @@
| A.java:16:14:16:17 | ...[...] | This array access might be out of bounds, as the index might be equal to the array length. |
| A.java:23:21:23:28 | ...[...] | This array access might be out of bounds, as the index might be equal to the array length. |
| A.java:37:14:37:22 | ...[...] | This array access might be out of bounds, as the index might be equal to the array length. |
| A.java:42:14:42:22 | ...[...] | This array access might be out of bounds, as the index might be equal to the array length. |
| A.java:46:14:46:22 | ...[...] | This array access might be out of bounds, as the index might be equal to the array length. |
| A.java:55:14:55:19 | ...[...] | This array access might be out of bounds, as the index might be equal to the array length. |

View File

@@ -24,7 +24,7 @@ public class ResponseSplitting extends HttpServlet {
}
// BAD: setting a header with an unvalidated parameter
// can lead to hTTP splitting
// can lead to HTTP splitting
response.addHeader("Content-type", request.getParameter("contentType"));
response.setHeader("Content-type", request.getParameter("contentType"));
@@ -42,4 +42,10 @@ public class ResponseSplitting extends HttpServlet {
private static String removeSpecial(String str) {
return str.replaceAll("[^a-zA-Z ]", "");
}
public void addCookieName(HttpServletResponse response, Cookie cookie) {
// GOOD: cookie.getName() cannot lead to HTTP splitting
Cookie cookie2 = new Cookie("name", cookie.getName());
response.addCookie(cookie2);
}
}

View File

@@ -25,25 +25,6 @@ predicate deadStoreOfLocal(VarDef vd, PurelyLocalVariable v) {
not exists (SsaExplicitDefinition ssa | ssa.defines(vd, v))
}
/**
* Holds if `e` is an expression evaluating to `null` or `undefined`.
*
* This includes not only direct references to `null` and `undefined`, but
* also `void` expressions and assignments of the form `x = rhs`, where `rhs`
* is itself an expression evaluating to `null` or `undefined`.
*/
predicate isNullOrUndef(Expr e) {
exists (Expr inner |
inner = e.stripParens() |
// `null` or `undefined`
inner instanceof NullLiteral or
inner.(VarAccess).getName() = "undefined" or
inner instanceof VoidExpr or
// recursive case to catch multi-assignments of the form `x = y = null`
isNullOrUndef(inner.(AssignExpr).getRhs())
)
}
/**
* Holds if `e` is an expression that may be used as a default initial value,
* such as `0` or `-1`, or an empty object or array literal.
@@ -57,9 +38,7 @@ predicate isDefaultInit(Expr e) {
// initialising to an empty array or object literal, even if unnecessary,
// can convey useful type information to the reader
e.(ArrayExpr).getSize() = 0 or
e.(ObjectExpr).getNumProperty() = 0 or
// recursive case
isDefaultInit(e.(AssignExpr).getRhs())
e.(ObjectExpr).getNumProperty() = 0
}
from VarDef dead, PurelyLocalVariable v // captured variables may be read by closures, so don't flag them
@@ -77,9 +56,9 @@ where deadStoreOfLocal(dead, v) and
not fd = outer.getBody().(BlockStmt).getAStmt()
) and
// don't flag overwrites with `null` or `undefined`
not isNullOrUndef(dead.getSource()) and
not SyntacticConstants::isNullOrUndefined(dead.getSource()) and
// don't flag default inits that are later overwritten
not (isDefaultInit(dead.getSource()) and dead.isOverwritten(v)) and
not (isDefaultInit(dead.getSource().(Expr).getUnderlyingValue()) and dead.isOverwritten(v)) and
// don't flag assignments in externs
not dead.(ASTNode).inExternsFile() and
// don't flag exported variables

View File

@@ -56,10 +56,17 @@ predicate isPropertyFilter(UnusedLocal v) {
predicate isReactImportForJSX(UnusedLocal v) {
exists (ImportSpecifier is |
is.getLocal() = v.getADeclaration() and
exists (JSXNode jsx | jsx.getTopLevel() = is.getTopLevel()) |
v.getName() = "React" or
// also accept legacy `@jsx` pragmas
exists (JSXNode jsx | jsx.getTopLevel() = is.getTopLevel())
|
v.getName() = "React"
or
// legacy `@jsx` pragmas
exists (JSXPragma p | p.getTopLevel() = is.getTopLevel() | p.getDOMName() = v.getName())
or
// JSX pragma from a .babelrc file
exists (Babel::TransformReactJsxConfig plugin |
plugin.appliesTo(is.getTopLevel()) and
plugin.getJsxFactoryVariableName() = v.getName())
)
}

View File

@@ -14,4 +14,4 @@ from Directive d
where not d instanceof KnownDirective and
// but exclude attribute top-levels: `<a href="javascript:'some-attribute-string'">`
not (d.getParent() instanceof CodeInAttribute)
select d, "Unknown directive: '" + d.getDirectiveText() + "'."
select d, "Unknown directive: '" + truncate(d.getDirectiveText(), 20, " ... (truncated)") + "'."

View File

@@ -67,7 +67,27 @@ private cached module Internal {
}
cached predicate defAt(BasicBlock bb, int i, Variable v, VarDef d) {
v = d.getAVariable() and bbIndex(bb, d, i)
exists (VarRef lhs |
lhs = d.getTarget().(BindingPattern).getABindingVarRef() and
v = lhs.getVariable() |
lhs = d.getTarget() and
bbIndex(bb, d, i)
or
exists (PropertyPattern pp |
lhs = pp.getValuePattern() and
bbIndex(bb, pp, i)
)
or
exists (ObjectPattern op |
lhs = op.getRest() and
bbIndex(bb, lhs, i)
)
or
exists (ArrayPattern ap |
lhs = ap.getAnElement() and
bbIndex(bb, lhs, i)
)
)
}
cached predicate reachableBB(BasicBlock bb) {

View File

@@ -127,14 +127,32 @@ module SyntacticConstants {
class WrappedConstant extends SyntacticConstant {
WrappedConstant() {
stripParens() instanceof SyntacticConstant or
this.(SeqExpr).getLastOperand() instanceof SyntacticConstant or
this.(TypeAssertion).getExpression() instanceof SyntacticConstant or
this.(Assignment).getRhs() instanceof SyntacticConstant
getUnderlyingValue() instanceof SyntacticConstant
}
}
/**
* Holds if `c` evaluates to `undefined`.
*/
predicate isUndefined(SyntacticConstant c) {
c.getUnderlyingValue() instanceof UndefinedConstant
}
/**
* Holds if `c` evaluates to `null`.
*/
predicate isNull(SyntacticConstant c) {
c.getUnderlyingValue() instanceof NullConstant
}
/**
* Holds if `c` evaluates to `null` or `undefined`.
*/
predicate isNullOrUndefined(SyntacticConstant c) {
isUndefined(c) or isNull(c)
}
}
/**

View File

@@ -98,7 +98,8 @@ private predicate lvalAux(Expr l, ControlFlowNode def) {
exists (ArrayPattern ap | lvalAux(ap, def) | l = ap.getAnElement().stripParens())
or
exists (ObjectPattern op | lvalAux(op, def) |
l = op.getAPropertyPattern().getValuePattern().stripParens()
l = op.getAPropertyPattern().getValuePattern().stripParens() or
l = op.getRest().stripParens()
)
}

View File

@@ -45,8 +45,45 @@ class ExprOrType extends @exprortype, Documentable {
)
}
/** Gets this expression or type, with any surrounding parentheses removed. */
/**
* Gets this expression or type, with any surrounding parentheses removed.
*
* Also see `getUnderlyingValue` and `getUnderlyingReference`.
*/
ExprOrType stripParens() { result = this }
/**
* Gets the innermost reference that this expression evaluates to, if any.
*
* Examples:
*
* - a variable or property access: the access itself.
* - a parenthesized expression `(e)`: the underlying reference of `e`.
* - a TypeScript type assertion `e as T`: the underlying reference of `e`.
*
* Also see `getUnderlyingValue` and `stripParens`.
*/
Expr getUnderlyingReference() {
none()
}
/**
* Gets the innermost expression that this expression evaluates to.
*
* Examples:
*
* - a parenthesised expression `(e)`: the underlying value of `e`.
* - a sequence expression `e1, e2`: the underlying value of `e2`.
* - an assignment expression `v = e`: the underlying value of `e`.
* - a TypeScript type assertion `e as T`: the underlying value of `e`.
* - any other expression: the expression itself.
*
* Also see `getUnderlyingReference` and `stripParens`.
*/
Expr getUnderlyingValue() {
result = this
}
}
/** An expression. */
@@ -210,6 +247,15 @@ class ParExpr extends @parexpr, Expr {
override predicate isImpure() {
getExpression().isImpure()
}
override Expr getUnderlyingValue() {
result = getExpression().getUnderlyingValue()
}
override Expr getUnderlyingReference() {
result = getExpression().getUnderlyingReference()
}
}
/** A `null` literal. */
@@ -617,6 +663,11 @@ class SeqExpr extends @seqexpr, Expr {
override string getStringValue() {
result = getLastOperand().getStringValue()
}
override Expr getUnderlyingValue() {
result = getLastOperand().getUnderlyingValue()
}
}
/** A conditional expression. */
@@ -862,6 +913,11 @@ class PropAccess extends @propaccess, Expr {
override ControlFlowNode getFirstControlFlowNode() {
result = getBase().getFirstControlFlowNode()
}
override Expr getUnderlyingReference() {
result = this
}
}
/** A dot expression. */
@@ -1284,10 +1340,17 @@ class Assignment extends @assignment, Expr {
override ControlFlowNode getFirstControlFlowNode() {
result = getLhs().getFirstControlFlowNode()
}
}
/** A simple assignment expression. */
class AssignExpr extends @assignexpr, Assignment {}
class AssignExpr extends @assignexpr, Assignment {
override Expr getUnderlyingValue() {
result = getRhs().getUnderlyingValue()
}
}
/** A compound assign expression. */
abstract class CompoundAssignExpr extends Assignment {}

View File

@@ -122,10 +122,7 @@ private cached module Internal {
}
or TPhi(ReachableJoinBlock bb, SsaSourceVariable v) {
liveAtEntry(bb, v) and
exists (ReachableBasicBlock defbb, SsaDefinition def |
def.definesAt(defbb, _, v) and
bb.inDominanceFrontierOf(defbb)
)
inDefDominanceFrontier(bb, v)
}
or TRefinement(ReachableBasicBlock bb, int i, GuardControlFlowNode guard, SsaSourceVariable v) {
bb.getNode(i) = guard and
@@ -133,6 +130,17 @@ private cached module Internal {
liveAtEntry(bb, v)
}
/**
* Holds if `bb` is in the dominance frontier of a block containing a definition of `v`.
*/
pragma[noinline]
private predicate inDefDominanceFrontier(ReachableJoinBlock bb, SsaSourceVariable v) {
exists (ReachableBasicBlock defbb, SsaDefinition def |
def.definesAt(defbb, _, v) and
bb.inDominanceFrontierOf(defbb)
)
}
/**
* Holds if `v` is a captured variable which is declared in `declContainer` and read in
* `useContainer`.
@@ -216,6 +224,13 @@ private cached module Internal {
ref(bb, i, v, tp)
}
/**
* Gets the maximum rank among all references to `v` in basic block `bb`.
*/
private int maxRefRank(ReachableBasicBlock bb, SsaSourceVariable v) {
result = max(refRank(bb, _, v, _))
}
/**
* Holds if variable `v` is live after the `i`th node of basic block `bb`, where
* `i` is the index of a node that may assign or capture `v`.
@@ -230,8 +245,8 @@ private cached module Internal {
or
// this is the last reference to `v` inside `bb`, but `v` is live at entry
// to a successor basic block of `bb`
r = max(refRank(bb, _, v, _)) and
liveAtEntry(bb.getASuccessor(), v)
r = maxRefRank(bb, v) and
liveAtSuccEntry(bb, v)
)
}
@@ -248,6 +263,13 @@ private cached module Internal {
// there is no reference to `v` inside `bb`, but `v` is live at entry
// to a successor basic block of `bb`
not exists(refRank(bb, _, v, _)) and
liveAtSuccEntry(bb, v)
}
/**
* Holds if `v` is live at the beginning of any successor of basic block `bb`.
*/
private predicate liveAtSuccEntry(ReachableBasicBlock bb, SsaSourceVariable v) {
liveAtEntry(bb.getASuccessor(), v)
}
@@ -311,25 +333,32 @@ private cached module Internal {
)
}
/**
* Gets an SSA definition of `v` that reaches the end of the immediate dominator of `bb`.
*/
pragma[noinline]
private SsaDefinition getDefReachingEndOfImmediateDominator(ReachableBasicBlock bb, SsaSourceVariable v) {
result = getDefReachingEndOf(bb.getImmediateDominator(), v)
}
/**
* Gets an SSA definition of `v` that reaches the end of basic block `bb`.
*/
cached SsaDefinition getDefReachingEndOf(ReachableBasicBlock bb, SsaSourceVariable v) {
bb.getASuccessor().localIsLiveAtEntry(v) and
(
exists (int lastRef | lastRef = max(int i | ssaRef(bb, i, v, _)) |
result = getLocalDefinition(bb, lastRef, v)
or
result.definesAt(bb, lastRef, v)
)
exists (int lastRef | lastRef = max(int i | ssaRef(bb, i, v, _)) |
result = getLocalDefinition(bb, lastRef, v)
or
/* In SSA form, the (unique) reaching definition of a use is the closest
* definition that dominates the use. If two definitions dominate a node
* then one must dominate the other, so we can find the reaching definition
* by following the idominance relation backwards. */
result = getDefReachingEndOf(bb.getImmediateDominator(), v) and
not exists (SsaDefinition ssa | ssa.definesAt(bb, _, v))
result.definesAt(bb, lastRef, v) and
liveAtSuccEntry(bb, v)
)
or
/* In SSA form, the (unique) reaching definition of a use is the closest
* definition that dominates the use. If two definitions dominate a node
* then one must dominate the other, so we can find the reaching definition
* by following the idominance relation backwards. */
result = getDefReachingEndOfImmediateDominator(bb, v) and
not exists (SsaDefinition ssa | ssa.definesAt(bb, _, v)) and
liveAtSuccEntry(bb, v)
}
/**

View File

@@ -1315,6 +1315,15 @@ class TypeAssertion extends Expr, @typeassertion {
override ControlFlowNode getFirstControlFlowNode() {
result = getExpression().getFirstControlFlowNode()
}
override Expr getUnderlyingValue() {
result = getExpression().getUnderlyingValue()
}
override Expr getUnderlyingReference() {
result = getExpression().getUnderlyingReference()
}
}
/**

View File

@@ -12,15 +12,25 @@ string capitalize(string s) {
result = s.charAt(0).toUpperCase() + s.suffix(1)
}
/**
* Gets the pluralization for `n` occurrences of `noun`.
*
* For example, the pluralization of `"function"` for `n = 2` is `"functions"`.
*/
/**
* Gets the pluralization for `n` occurrences of `noun`.
*
* For example, the pluralization of `"function"` for `n = 2` is `"functions"`.
*/
bindingset[noun, n]
string pluralize(string noun, int n) {
if n = 1 then
result = noun
else
result = noun + "s"
}
}
/**
* Gets `str` or a truncated version of `str` with `explanation` appended if its length exceeds `maxLength`.
*
* For example, the truncation of `"long_string"` for `maxLength = 5` and explanation `" ..."` is `"long_ ..."`.
*/
bindingset[str, maxLength, explanation]
string truncate(string str, int maxLength, string explanation) {
if str.length() > maxLength then result = str.prefix(maxLength) + explanation else result = str
}

View File

@@ -298,6 +298,11 @@ class VarRef extends @varref, Identifier, BindingPattern, LexicalRef {
override VarRef getABindingVarRef() { result = this }
override predicate isImpure() { none() }
override Expr getUnderlyingReference() {
result = this
}
}
/** An identifier that refers to a variable in a non-declaring position. */

Some files were not shown because too many files have changed in this diff Show More