mirror of
https://github.com/github/codeql.git
synced 2026-04-30 03:05:15 +02:00
Merge branch 'main' into alternative-instruction-operand-flow
This commit is contained in:
@@ -8,8 +8,8 @@ private newtype TBound =
|
||||
exists(Instruction i |
|
||||
vn.getAnInstruction() = i and
|
||||
(
|
||||
i.getResultType() instanceof IntegralType or
|
||||
i.getResultType() instanceof PointerType
|
||||
i.getResultIRType() instanceof IRIntegerType or
|
||||
i.getResultIRType() instanceof IRAddressType
|
||||
) and
|
||||
not vn.getAnInstruction() instanceof ConstantInstruction
|
||||
|
|
||||
|
||||
@@ -244,14 +244,14 @@ class CondReason extends Reason, TCondReason {
|
||||
/**
|
||||
* Holds if `typ` is a small integral type with the given lower and upper bounds.
|
||||
*/
|
||||
private predicate typeBound(IntegralType typ, int lowerbound, int upperbound) {
|
||||
typ.isSigned() and typ.getSize() = 1 and lowerbound = -128 and upperbound = 127
|
||||
private predicate typeBound(IRIntegerType typ, int lowerbound, int upperbound) {
|
||||
typ.isSigned() and typ.getByteSize() = 1 and lowerbound = -128 and upperbound = 127
|
||||
or
|
||||
typ.isUnsigned() and typ.getSize() = 1 and lowerbound = 0 and upperbound = 255
|
||||
typ.isUnsigned() and typ.getByteSize() = 1 and lowerbound = 0 and upperbound = 255
|
||||
or
|
||||
typ.isSigned() and typ.getSize() = 2 and lowerbound = -32768 and upperbound = 32767
|
||||
typ.isSigned() and typ.getByteSize() = 2 and lowerbound = -32768 and upperbound = 32767
|
||||
or
|
||||
typ.isUnsigned() and typ.getSize() = 2 and lowerbound = 0 and upperbound = 65535
|
||||
typ.isUnsigned() and typ.getByteSize() = 2 and lowerbound = 0 and upperbound = 65535
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -260,14 +260,14 @@ private predicate typeBound(IntegralType typ, int lowerbound, int upperbound) {
|
||||
private class NarrowingCastInstruction extends ConvertInstruction {
|
||||
NarrowingCastInstruction() {
|
||||
not this instanceof SafeCastInstruction and
|
||||
typeBound(getResultType(), _, _)
|
||||
typeBound(getResultIRType(), _, _)
|
||||
}
|
||||
|
||||
/** Gets the lower bound of the resulting type. */
|
||||
int getLowerBound() { typeBound(getResultType(), result, _) }
|
||||
int getLowerBound() { typeBound(getResultIRType(), result, _) }
|
||||
|
||||
/** Gets the upper bound of the resulting type. */
|
||||
int getUpperBound() { typeBound(getResultType(), _, result) }
|
||||
int getUpperBound() { typeBound(getResultIRType(), _, result) }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -86,15 +86,15 @@ predicate backEdge(PhiInstruction phi, PhiInputOperand op) {
|
||||
* range analysis.
|
||||
*/
|
||||
pragma[inline]
|
||||
private predicate safeCast(IntegralType fromtyp, IntegralType totyp) {
|
||||
fromtyp.getSize() < totyp.getSize() and
|
||||
private predicate safeCast(IRIntegerType fromtyp, IRIntegerType totyp) {
|
||||
fromtyp.getByteSize() < totyp.getByteSize() and
|
||||
(
|
||||
fromtyp.isUnsigned()
|
||||
or
|
||||
totyp.isSigned()
|
||||
)
|
||||
or
|
||||
fromtyp.getSize() <= totyp.getSize() and
|
||||
fromtyp.getByteSize() <= totyp.getByteSize() and
|
||||
(
|
||||
fromtyp.isSigned() and
|
||||
totyp.isSigned()
|
||||
@@ -109,8 +109,8 @@ private predicate safeCast(IntegralType fromtyp, IntegralType totyp) {
|
||||
*/
|
||||
class PtrToPtrCastInstruction extends ConvertInstruction {
|
||||
PtrToPtrCastInstruction() {
|
||||
getResultType() instanceof PointerType and
|
||||
getUnary().getResultType() instanceof PointerType
|
||||
getResultIRType() instanceof IRAddressType and
|
||||
getUnary().getResultIRType() instanceof IRAddressType
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ class PtrToPtrCastInstruction extends ConvertInstruction {
|
||||
* that cannot overflow or underflow.
|
||||
*/
|
||||
class SafeIntCastInstruction extends ConvertInstruction {
|
||||
SafeIntCastInstruction() { safeCast(getUnary().getResultType(), getResultType()) }
|
||||
SafeIntCastInstruction() { safeCast(getUnary().getResultIRType(), getResultIRType()) }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -469,7 +469,7 @@ module SignAnalysisCached {
|
||||
not exists(certainInstructionSign(i)) and
|
||||
not (
|
||||
result = TNeg() and
|
||||
i.getResultType().(IntegralType).isUnsigned()
|
||||
i.getResultIRType().(IRIntegerType).isUnsigned()
|
||||
) and
|
||||
(
|
||||
unknownSign(i)
|
||||
@@ -477,9 +477,13 @@ module SignAnalysisCached {
|
||||
exists(ConvertInstruction ci, Instruction prior, boolean fromSigned, boolean toSigned |
|
||||
i = ci and
|
||||
prior = ci.getUnary() and
|
||||
(if ci.getResultType().(IntegralType).isSigned() then toSigned = true else toSigned = false) and
|
||||
(
|
||||
if prior.getResultType().(IntegralType).isSigned()
|
||||
if ci.getResultIRType().(IRIntegerType).isSigned()
|
||||
then toSigned = true
|
||||
else toSigned = false
|
||||
) and
|
||||
(
|
||||
if prior.getResultIRType().(IRIntegerType).isSigned()
|
||||
then fromSigned = true
|
||||
else fromSigned = false
|
||||
) and
|
||||
@@ -512,11 +516,11 @@ module SignAnalysisCached {
|
||||
i instanceof ShiftLeftInstruction and result = s1.lshift(s2)
|
||||
or
|
||||
i instanceof ShiftRightInstruction and
|
||||
i.getResultType().(IntegralType).isSigned() and
|
||||
i.getResultIRType().(IRIntegerType).isSigned() and
|
||||
result = s1.rshift(s2)
|
||||
or
|
||||
i instanceof ShiftRightInstruction and
|
||||
not i.getResultType().(IntegralType).isSigned() and
|
||||
not i.getResultIRType().(IRIntegerType).isSigned() and
|
||||
result = s1.urshift(s2)
|
||||
)
|
||||
or
|
||||
|
||||
27
cpp/ql/src/printAst.ql
Normal file
27
cpp/ql/src/printAst.ql
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* @name Print AST
|
||||
* @description Outputs a representation of a file's Abstract Syntax Tree. This
|
||||
* query is used by the VS Code extension.
|
||||
* @id cpp/print-ast
|
||||
* @kind graph
|
||||
* @tags ide-contextual-queries/print-ast
|
||||
*/
|
||||
|
||||
import cpp
|
||||
import semmle.code.cpp.PrintAST
|
||||
import definitions
|
||||
|
||||
/**
|
||||
* The source file to generate an AST from.
|
||||
*/
|
||||
external string selectedSourceFile();
|
||||
|
||||
class Cfg extends PrintASTConfiguration {
|
||||
/**
|
||||
* Holds if the AST for `func` should be printed.
|
||||
* Print All functions from the selected file.
|
||||
*/
|
||||
override predicate shouldPrintFunction(Function func) {
|
||||
func.getFile() = getEncodedFile(selectedSourceFile())
|
||||
}
|
||||
}
|
||||
@@ -33,11 +33,13 @@ class PreprocessorDirective extends Locatable, @preprocdirect {
|
||||
}
|
||||
}
|
||||
|
||||
private class TPreprocessorBranchDirective = @ppd_branch or @ppd_else or @ppd_endif;
|
||||
|
||||
/**
|
||||
* A C/C++ preprocessor branch related directive: `#if`, `#ifdef`,
|
||||
* `#ifndef`, `#elif`, `#else` or `#endif`.
|
||||
*/
|
||||
abstract class PreprocessorBranchDirective extends PreprocessorDirective {
|
||||
class PreprocessorBranchDirective extends PreprocessorDirective, TPreprocessorBranchDirective {
|
||||
/**
|
||||
* Gets the `#if`, `#ifdef` or `#ifndef` directive which matches this
|
||||
* branching directive.
|
||||
|
||||
@@ -234,20 +234,20 @@ predicate clearsContent(Node n, Content c) {
|
||||
}
|
||||
|
||||
/** Gets the type of `n` used for type pruning. */
|
||||
Type getNodeType(Node n) {
|
||||
IRType getNodeType(Node n) {
|
||||
suppressUnusedNode(n) and
|
||||
result instanceof VoidType // stub implementation
|
||||
result instanceof IRVoidType // stub implementation
|
||||
}
|
||||
|
||||
/** Gets a string representation of a type returned by `getNodeType`. */
|
||||
string ppReprType(Type t) { none() } // stub implementation
|
||||
string ppReprType(IRType t) { none() } // stub implementation
|
||||
|
||||
/**
|
||||
* Holds if `t1` and `t2` are compatible, that is, whether data can flow from
|
||||
* a node of type `t1` to a node of type `t2`.
|
||||
*/
|
||||
pragma[inline]
|
||||
predicate compatibleTypes(Type t1, Type t2) {
|
||||
predicate compatibleTypes(IRType t1, IRType t2) {
|
||||
any() // stub implementation
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@ class DataFlowCallable = Declaration;
|
||||
|
||||
class DataFlowExpr = Expr;
|
||||
|
||||
class DataFlowType = Type;
|
||||
class DataFlowType = IRType;
|
||||
|
||||
/** A function call relevant for data flow. */
|
||||
class DataFlowCall extends CallInstruction {
|
||||
|
||||
@@ -34,7 +34,7 @@ class Node extends TIRDataFlowNode {
|
||||
Function getFunction() { none() } // overridden in subclasses
|
||||
|
||||
/** Gets the type of this node. */
|
||||
Type getType() { none() } // overridden in subclasses
|
||||
IRType getType() { none() } // overridden in subclasses
|
||||
|
||||
/** Gets the instruction corresponding to this node, if any. */
|
||||
Instruction asInstruction() { result = this.(InstructionNode).getInstruction() }
|
||||
@@ -89,7 +89,7 @@ class Node extends TIRDataFlowNode {
|
||||
/**
|
||||
* Gets an upper bound on the type of this node.
|
||||
*/
|
||||
Type getTypeBound() { result = getType() }
|
||||
IRType getTypeBound() { result = getType() }
|
||||
|
||||
/** Gets the location of this element. */
|
||||
Location getLocation() { none() } // overridden by subclasses
|
||||
@@ -126,7 +126,7 @@ class InstructionNode extends Node, TInstructionNode {
|
||||
|
||||
override Function getFunction() { result = instr.getEnclosingFunction() }
|
||||
|
||||
override Type getType() { result = instr.getResultType() }
|
||||
override IRType getType() { result = instr.getResultIRType() }
|
||||
|
||||
override Location getLocation() { result = instr.getLocation() }
|
||||
|
||||
@@ -152,7 +152,7 @@ class OperandNode extends Node, TOperandNode {
|
||||
|
||||
override Function getFunction() { result = op.getUse().getEnclosingFunction() }
|
||||
|
||||
override Type getType() { result = op.getType() }
|
||||
override IRType getType() { result = op.getIRType() }
|
||||
|
||||
override Location getLocation() { result = op.getLocation() }
|
||||
|
||||
@@ -450,7 +450,7 @@ class VariableNode extends Node, TVariableNode {
|
||||
result = v
|
||||
}
|
||||
|
||||
override Type getType() { result = v.getType() }
|
||||
override IRType getType() { result.getCanonicalLanguageType().hasUnspecifiedType(v.getType(), _) }
|
||||
|
||||
override Location getLocation() { result = v.getLocation() }
|
||||
|
||||
|
||||
@@ -152,6 +152,12 @@ class IRIntegerType extends IRNumericType {
|
||||
this = TIRSignedIntegerType(byteSize) or
|
||||
this = TIRUnsignedIntegerType(byteSize)
|
||||
}
|
||||
|
||||
/** Holds if this integer type is signed. */
|
||||
predicate isSigned() { none() }
|
||||
|
||||
/** Holds if this integer type is unsigned. */
|
||||
predicate isUnsigned() { none() }
|
||||
// Don't override `getByteSize()` here. The optimizer seems to generate better code when this is
|
||||
// overridden only in the leaf classes.
|
||||
}
|
||||
@@ -169,6 +175,8 @@ class IRSignedIntegerType extends IRIntegerType, TIRSignedIntegerType {
|
||||
|
||||
pragma[noinline]
|
||||
final override int getByteSize() { result = byteSize }
|
||||
|
||||
override predicate isSigned() { any() }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -184,6 +192,8 @@ class IRUnsignedIntegerType extends IRIntegerType, TIRUnsignedIntegerType {
|
||||
|
||||
pragma[noinline]
|
||||
final override int getByteSize() { result = byteSize }
|
||||
|
||||
override predicate isUnsigned() { any() }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -724,7 +724,7 @@ private float getLowerBoundsImpl(Expr expr) {
|
||||
exists(RShiftExpr rsExpr, float left, int right |
|
||||
rsExpr = expr and
|
||||
left = getFullyConvertedLowerBounds(rsExpr.getLeftOperand()) and
|
||||
right = rsExpr.getRightOperand().getValue().toInt() and
|
||||
right = rsExpr.getRightOperand().getFullyConverted().getValue().toInt() and
|
||||
result = safeFloor(left / 2.pow(right))
|
||||
)
|
||||
}
|
||||
@@ -893,7 +893,7 @@ private float getUpperBoundsImpl(Expr expr) {
|
||||
exists(RShiftExpr rsExpr, float left, int right |
|
||||
rsExpr = expr and
|
||||
left = getFullyConvertedUpperBounds(rsExpr.getLeftOperand()) and
|
||||
right = rsExpr.getRightOperand().getValue().toInt() and
|
||||
right = rsExpr.getRightOperand().getFullyConverted().getValue().toInt() and
|
||||
result = safeFloor(left / 2.pow(right))
|
||||
)
|
||||
}
|
||||
|
||||
@@ -137,12 +137,14 @@ class Stmt extends StmtParent, @stmt {
|
||||
predicate isCompilerGenerated() { compgenerated(underlyingElement(this)) }
|
||||
}
|
||||
|
||||
private class TStmtParent = @stmt or @expr;
|
||||
|
||||
/**
|
||||
* An element that is the parent of a statement in the C/C++ AST.
|
||||
*
|
||||
* This is normally a statement, but may be a `StmtExpr`.
|
||||
*/
|
||||
abstract class StmtParent extends ControlFlowNode { }
|
||||
class StmtParent extends ControlFlowNode, TStmtParent { }
|
||||
|
||||
/**
|
||||
* A C/C++ 'expression' statement.
|
||||
@@ -179,28 +181,32 @@ class ExprStmt extends Stmt, @stmt_expr {
|
||||
}
|
||||
}
|
||||
|
||||
private class TControlStructure = TConditionalStmt or TLoop;
|
||||
|
||||
/**
|
||||
* A C/C++ control structure, that is, either a conditional statement or
|
||||
* a loop.
|
||||
*/
|
||||
abstract class ControlStructure extends Stmt {
|
||||
class ControlStructure extends Stmt, TControlStructure {
|
||||
/**
|
||||
* Gets the controlling expression of this control structure.
|
||||
*
|
||||
* This is the condition of 'if' statements and loops, and the
|
||||
* switched expression for 'switch' statements.
|
||||
*/
|
||||
abstract Expr getControllingExpr();
|
||||
Expr getControllingExpr() { none() } // overridden by subclasses
|
||||
|
||||
/** Gets a child declaration of this scope. */
|
||||
Declaration getADeclaration() { none() }
|
||||
}
|
||||
|
||||
private class TConditionalStmt = @stmt_if or @stmt_constexpr_if or @stmt_switch;
|
||||
|
||||
/**
|
||||
* A C/C++ conditional statement, that is, either an 'if' statement or a
|
||||
* 'switch' statement.
|
||||
*/
|
||||
abstract class ConditionalStmt extends ControlStructure { }
|
||||
class ConditionalStmt extends ControlStructure, TConditionalStmt { }
|
||||
|
||||
/**
|
||||
* A C/C++ 'if' statement. For example, the `if` statement in the following
|
||||
@@ -374,16 +380,18 @@ class ConstexprIfStmt extends ConditionalStmt, @stmt_constexpr_if {
|
||||
}
|
||||
}
|
||||
|
||||
private class TLoop = @stmt_while or @stmt_end_test_while or @stmt_range_based_for or @stmt_for;
|
||||
|
||||
/**
|
||||
* A C/C++ loop, that is, either a 'while' loop, a 'for' loop, or a
|
||||
* 'do' loop.
|
||||
*/
|
||||
abstract class Loop extends ControlStructure {
|
||||
class Loop extends ControlStructure, TLoop {
|
||||
/** Gets the condition expression of this loop. */
|
||||
abstract Expr getCondition();
|
||||
Expr getCondition() { none() } // overridden in subclasses
|
||||
|
||||
/** Gets the body statement of this loop. */
|
||||
abstract Stmt getStmt();
|
||||
Stmt getStmt() { none() } // overridden in subclasses
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -461,7 +469,7 @@ class WhileStmt extends Loop, @stmt_while {
|
||||
/**
|
||||
* A C/C++ jump statement.
|
||||
*/
|
||||
abstract class JumpStmt extends Stmt, @jump {
|
||||
class JumpStmt extends Stmt, @jump {
|
||||
override string getAPrimaryQlClass() { result = "JumpStmt" }
|
||||
|
||||
/** Gets the target of this jump statement. */
|
||||
|
||||
@@ -465,88 +465,133 @@
|
||||
| swap1.cpp:36:13:36:16 | this | swap1.cpp:37:21:37:24 | this | |
|
||||
| swap1.cpp:36:18:36:21 | ref arg that | swap1.cpp:34:34:34:37 | that | |
|
||||
| swap1.cpp:37:21:37:24 | this | swap1.cpp:37:20:37:24 | * ... | TAINT |
|
||||
| swap1.cpp:40:14:40:17 | this | swap1.cpp:43:18:43:22 | this | |
|
||||
| swap1.cpp:40:26:40:29 | that | swap1.cpp:40:26:40:29 | that | |
|
||||
| swap1.cpp:40:26:40:29 | that | swap1.cpp:43:25:43:28 | that | |
|
||||
| swap1.cpp:43:18:43:22 | data1 | swap1.cpp:43:30:43:34 | ref arg data1 | |
|
||||
| swap1.cpp:43:25:43:28 | that | swap1.cpp:43:18:43:22 | ref arg data1 | |
|
||||
| swap1.cpp:43:25:43:28 | that [post update] | swap1.cpp:40:26:40:29 | that | |
|
||||
| swap1.cpp:43:30:43:34 | data1 | swap1.cpp:43:18:43:22 | ref arg data1 | |
|
||||
| swap1.cpp:48:22:48:22 | x | swap1.cpp:48:22:48:22 | x | |
|
||||
| swap1.cpp:48:22:48:22 | x | swap1.cpp:50:9:50:9 | x | |
|
||||
| swap1.cpp:48:22:48:22 | x | swap2.cpp:48:22:48:22 | x | |
|
||||
| swap1.cpp:48:22:48:22 | x | swap2.cpp:50:9:50:9 | x | |
|
||||
| swap1.cpp:48:32:48:32 | y | swap1.cpp:48:32:48:32 | y | |
|
||||
| swap1.cpp:48:32:48:32 | y | swap1.cpp:50:16:50:16 | y | |
|
||||
| swap1.cpp:48:32:48:32 | y | swap2.cpp:48:32:48:32 | y | |
|
||||
| swap1.cpp:48:32:48:32 | y | swap2.cpp:50:16:50:16 | y | |
|
||||
| swap1.cpp:50:9:50:9 | ref arg x | swap1.cpp:48:22:48:22 | x | |
|
||||
| swap1.cpp:50:9:50:9 | ref arg x | swap2.cpp:48:22:48:22 | x | |
|
||||
| swap1.cpp:50:16:50:16 | ref arg y | swap1.cpp:48:32:48:32 | y | |
|
||||
| swap1.cpp:50:16:50:16 | ref arg y | swap2.cpp:48:32:48:32 | y | |
|
||||
| swap1.cpp:56:23:56:23 | x | swap1.cpp:58:5:58:5 | x | |
|
||||
| swap1.cpp:56:23:56:23 | x | swap1.cpp:60:10:60:10 | x | |
|
||||
| swap1.cpp:56:23:56:23 | x | swap1.cpp:63:9:63:9 | x | |
|
||||
| swap1.cpp:56:23:56:23 | x | swap1.cpp:66:10:66:10 | x | |
|
||||
| swap1.cpp:57:23:57:23 | y | swap1.cpp:61:10:61:10 | y | |
|
||||
| swap1.cpp:57:23:57:23 | y | swap1.cpp:63:5:63:5 | y | |
|
||||
| swap1.cpp:57:23:57:23 | y | swap1.cpp:65:10:65:10 | y | |
|
||||
| swap1.cpp:58:5:58:5 | x [post update] | swap1.cpp:60:10:60:10 | x | |
|
||||
| swap1.cpp:58:5:58:5 | x [post update] | swap1.cpp:63:9:63:9 | x | |
|
||||
| swap1.cpp:58:5:58:5 | x [post update] | swap1.cpp:66:10:66:10 | x | |
|
||||
| swap1.cpp:58:5:58:22 | ... = ... | swap1.cpp:60:12:60:16 | data1 | |
|
||||
| swap1.cpp:58:5:58:22 | ... = ... | swap1.cpp:66:12:66:16 | data1 | |
|
||||
| swap1.cpp:58:15:58:20 | call to source | swap1.cpp:58:5:58:22 | ... = ... | |
|
||||
| swap1.cpp:63:5:63:5 | ref arg y | swap1.cpp:65:10:65:10 | y | |
|
||||
| swap1.cpp:63:9:63:9 | x | swap1.cpp:63:5:63:5 | ref arg y | TAINT |
|
||||
| swap1.cpp:63:9:63:9 | x | swap1.cpp:63:7:63:7 | call to operator= | TAINT |
|
||||
| swap1.cpp:68:23:68:24 | z1 | swap1.cpp:69:5:69:6 | z1 | |
|
||||
| swap1.cpp:68:23:68:24 | z1 | swap1.cpp:70:10:70:11 | z1 | |
|
||||
| swap1.cpp:68:23:68:24 | z1 | swap1.cpp:72:10:72:11 | z1 | |
|
||||
| swap1.cpp:68:23:68:24 | z1 | swap1.cpp:75:10:75:11 | z1 | |
|
||||
| swap1.cpp:68:27:68:28 | z2 | swap1.cpp:72:14:72:15 | z2 | |
|
||||
| swap1.cpp:68:27:68:28 | z2 | swap1.cpp:74:10:74:11 | z2 | |
|
||||
| swap1.cpp:69:5:69:6 | z1 [post update] | swap1.cpp:70:10:70:11 | z1 | |
|
||||
| swap1.cpp:69:5:69:6 | z1 [post update] | swap1.cpp:72:10:72:11 | z1 | |
|
||||
| swap1.cpp:69:5:69:6 | z1 [post update] | swap1.cpp:75:10:75:11 | z1 | |
|
||||
| swap1.cpp:69:5:69:23 | ... = ... | swap1.cpp:70:13:70:17 | data1 | |
|
||||
| swap1.cpp:69:5:69:23 | ... = ... | swap1.cpp:75:13:75:17 | data1 | |
|
||||
| swap1.cpp:69:16:69:21 | call to source | swap1.cpp:69:5:69:23 | ... = ... | |
|
||||
| swap1.cpp:72:10:72:11 | ref arg z1 | swap1.cpp:75:10:75:11 | z1 | |
|
||||
| swap1.cpp:72:14:72:15 | ref arg z2 | swap1.cpp:74:10:74:11 | z2 | |
|
||||
| swap1.cpp:80:23:80:23 | x | swap1.cpp:82:5:82:5 | x | |
|
||||
| swap1.cpp:80:23:80:23 | x | swap1.cpp:84:10:84:10 | x | |
|
||||
| swap1.cpp:80:23:80:23 | x | swap1.cpp:87:19:87:19 | x | |
|
||||
| swap1.cpp:80:23:80:23 | x | swap1.cpp:90:10:90:10 | x | |
|
||||
| swap1.cpp:81:23:81:23 | y | swap1.cpp:85:10:85:10 | y | |
|
||||
| swap1.cpp:81:23:81:23 | y | swap1.cpp:87:5:87:5 | y | |
|
||||
| swap1.cpp:81:23:81:23 | y | swap1.cpp:89:10:89:10 | y | |
|
||||
| swap1.cpp:82:5:82:5 | x [post update] | swap1.cpp:84:10:84:10 | x | |
|
||||
| swap1.cpp:82:5:82:5 | x [post update] | swap1.cpp:87:19:87:19 | x | |
|
||||
| swap1.cpp:82:5:82:5 | x [post update] | swap1.cpp:90:10:90:10 | x | |
|
||||
| swap1.cpp:82:5:82:22 | ... = ... | swap1.cpp:84:12:84:16 | data1 | |
|
||||
| swap1.cpp:82:5:82:22 | ... = ... | swap1.cpp:90:12:90:16 | data1 | |
|
||||
| swap1.cpp:82:15:82:20 | call to source | swap1.cpp:82:5:82:22 | ... = ... | |
|
||||
| swap1.cpp:87:5:87:5 | ref arg y | swap1.cpp:89:10:89:10 | y | |
|
||||
| swap1.cpp:87:9:87:17 | call to move | swap1.cpp:87:5:87:5 | ref arg y | TAINT |
|
||||
| swap1.cpp:87:9:87:17 | call to move | swap1.cpp:87:7:87:7 | call to operator= | TAINT |
|
||||
| swap1.cpp:87:9:87:17 | ref arg call to move | swap1.cpp:87:19:87:19 | x [inner post update] | |
|
||||
| swap1.cpp:87:9:87:17 | ref arg call to move | swap1.cpp:90:10:90:10 | x | |
|
||||
| swap1.cpp:87:19:87:19 | x | swap1.cpp:87:5:87:5 | ref arg y | TAINT |
|
||||
| swap1.cpp:87:19:87:19 | x | swap1.cpp:87:7:87:7 | call to operator= | TAINT |
|
||||
| swap1.cpp:87:19:87:19 | x | swap1.cpp:87:9:87:17 | call to move | |
|
||||
| swap1.cpp:95:23:95:31 | move_from | swap1.cpp:96:5:96:13 | move_from | |
|
||||
| swap1.cpp:95:23:95:31 | move_from | swap1.cpp:98:10:98:18 | move_from | |
|
||||
| swap1.cpp:95:23:95:31 | move_from | swap1.cpp:100:41:100:49 | move_from | |
|
||||
| swap1.cpp:96:5:96:13 | move_from [post update] | swap1.cpp:98:10:98:18 | move_from | |
|
||||
| swap1.cpp:96:5:96:13 | move_from [post update] | swap1.cpp:100:41:100:49 | move_from | |
|
||||
| swap1.cpp:96:5:96:30 | ... = ... | swap1.cpp:98:20:98:24 | data1 | |
|
||||
| swap1.cpp:96:5:96:30 | ... = ... | swap1.cpp:102:18:102:22 | data1 | |
|
||||
| swap1.cpp:96:23:96:28 | call to source | swap1.cpp:96:5:96:30 | ... = ... | |
|
||||
| swap1.cpp:100:31:100:39 | call to move | swap1.cpp:100:31:100:51 | call to Class | |
|
||||
| swap1.cpp:100:31:100:39 | ref arg call to move | swap1.cpp:100:41:100:49 | move_from [inner post update] | |
|
||||
| swap1.cpp:100:31:100:51 | call to Class | swap1.cpp:102:10:102:16 | move_to | |
|
||||
| swap1.cpp:100:41:100:49 | move_from | swap1.cpp:100:31:100:39 | call to move | |
|
||||
| swap1.cpp:40:16:40:26 | this | swap1.cpp:43:13:43:16 | this | |
|
||||
| swap1.cpp:40:41:40:44 | that | swap1.cpp:42:24:42:27 | that | |
|
||||
| swap1.cpp:42:23:42:27 | call to Class | swap1.cpp:43:18:43:20 | tmp | |
|
||||
| swap1.cpp:42:24:42:27 | that | swap1.cpp:42:23:42:27 | call to Class | |
|
||||
| swap1.cpp:43:13:43:16 | ref arg this | swap1.cpp:44:21:44:24 | this | |
|
||||
| swap1.cpp:43:13:43:16 | this | swap1.cpp:44:21:44:24 | this | |
|
||||
| swap1.cpp:44:21:44:24 | this | swap1.cpp:44:20:44:24 | * ... | TAINT |
|
||||
| swap1.cpp:47:16:47:26 | this | swap1.cpp:49:13:49:16 | this | |
|
||||
| swap1.cpp:47:36:47:39 | that | swap1.cpp:47:36:47:39 | that | |
|
||||
| swap1.cpp:47:36:47:39 | that | swap1.cpp:49:18:49:21 | that | |
|
||||
| swap1.cpp:49:13:49:16 | ref arg this | swap1.cpp:50:21:50:24 | this | |
|
||||
| swap1.cpp:49:13:49:16 | this | swap1.cpp:50:21:50:24 | this | |
|
||||
| swap1.cpp:49:18:49:21 | ref arg that | swap1.cpp:47:36:47:39 | that | |
|
||||
| swap1.cpp:50:21:50:24 | this | swap1.cpp:50:20:50:24 | * ... | TAINT |
|
||||
| swap1.cpp:53:14:53:17 | this | swap1.cpp:56:18:56:22 | this | |
|
||||
| swap1.cpp:53:26:53:29 | that | swap1.cpp:53:26:53:29 | that | |
|
||||
| swap1.cpp:53:26:53:29 | that | swap1.cpp:56:25:56:28 | that | |
|
||||
| swap1.cpp:56:18:56:22 | data1 | swap1.cpp:56:30:56:34 | ref arg data1 | |
|
||||
| swap1.cpp:56:25:56:28 | that | swap1.cpp:56:18:56:22 | ref arg data1 | |
|
||||
| swap1.cpp:56:25:56:28 | that [post update] | swap1.cpp:53:26:53:29 | that | |
|
||||
| swap1.cpp:56:30:56:34 | data1 | swap1.cpp:56:18:56:22 | ref arg data1 | |
|
||||
| swap1.cpp:61:22:61:22 | x | swap1.cpp:61:22:61:22 | x | |
|
||||
| swap1.cpp:61:22:61:22 | x | swap1.cpp:63:9:63:9 | x | |
|
||||
| swap1.cpp:61:22:61:22 | x | swap2.cpp:61:22:61:22 | x | |
|
||||
| swap1.cpp:61:22:61:22 | x | swap2.cpp:63:9:63:9 | x | |
|
||||
| swap1.cpp:61:32:61:32 | y | swap1.cpp:61:32:61:32 | y | |
|
||||
| swap1.cpp:61:32:61:32 | y | swap1.cpp:63:16:63:16 | y | |
|
||||
| swap1.cpp:61:32:61:32 | y | swap2.cpp:61:32:61:32 | y | |
|
||||
| swap1.cpp:61:32:61:32 | y | swap2.cpp:63:16:63:16 | y | |
|
||||
| swap1.cpp:63:9:63:9 | ref arg x | swap1.cpp:61:22:61:22 | x | |
|
||||
| swap1.cpp:63:9:63:9 | ref arg x | swap2.cpp:61:22:61:22 | x | |
|
||||
| swap1.cpp:63:16:63:16 | ref arg y | swap1.cpp:61:32:61:32 | y | |
|
||||
| swap1.cpp:63:16:63:16 | ref arg y | swap2.cpp:61:32:61:32 | y | |
|
||||
| swap1.cpp:69:23:69:23 | x | swap1.cpp:71:5:71:5 | x | |
|
||||
| swap1.cpp:69:23:69:23 | x | swap1.cpp:73:10:73:10 | x | |
|
||||
| swap1.cpp:69:23:69:23 | x | swap1.cpp:76:9:76:9 | x | |
|
||||
| swap1.cpp:69:23:69:23 | x | swap1.cpp:79:10:79:10 | x | |
|
||||
| swap1.cpp:70:23:70:23 | y | swap1.cpp:74:10:74:10 | y | |
|
||||
| swap1.cpp:70:23:70:23 | y | swap1.cpp:76:5:76:5 | y | |
|
||||
| swap1.cpp:70:23:70:23 | y | swap1.cpp:78:10:78:10 | y | |
|
||||
| swap1.cpp:71:5:71:5 | x [post update] | swap1.cpp:73:10:73:10 | x | |
|
||||
| swap1.cpp:71:5:71:5 | x [post update] | swap1.cpp:76:9:76:9 | x | |
|
||||
| swap1.cpp:71:5:71:5 | x [post update] | swap1.cpp:79:10:79:10 | x | |
|
||||
| swap1.cpp:71:5:71:22 | ... = ... | swap1.cpp:73:12:73:16 | data1 | |
|
||||
| swap1.cpp:71:5:71:22 | ... = ... | swap1.cpp:79:12:79:16 | data1 | |
|
||||
| swap1.cpp:71:15:71:20 | call to source | swap1.cpp:71:5:71:22 | ... = ... | |
|
||||
| swap1.cpp:76:5:76:5 | ref arg y | swap1.cpp:78:10:78:10 | y | |
|
||||
| swap1.cpp:76:9:76:9 | x | swap1.cpp:76:5:76:5 | ref arg y | TAINT |
|
||||
| swap1.cpp:76:9:76:9 | x | swap1.cpp:76:7:76:7 | call to operator= | TAINT |
|
||||
| swap1.cpp:81:23:81:24 | z1 | swap1.cpp:82:5:82:6 | z1 | |
|
||||
| swap1.cpp:81:23:81:24 | z1 | swap1.cpp:83:10:83:11 | z1 | |
|
||||
| swap1.cpp:81:23:81:24 | z1 | swap1.cpp:85:10:85:11 | z1 | |
|
||||
| swap1.cpp:81:23:81:24 | z1 | swap1.cpp:88:10:88:11 | z1 | |
|
||||
| swap1.cpp:81:27:81:28 | z2 | swap1.cpp:85:14:85:15 | z2 | |
|
||||
| swap1.cpp:81:27:81:28 | z2 | swap1.cpp:87:10:87:11 | z2 | |
|
||||
| swap1.cpp:82:5:82:6 | z1 [post update] | swap1.cpp:83:10:83:11 | z1 | |
|
||||
| swap1.cpp:82:5:82:6 | z1 [post update] | swap1.cpp:85:10:85:11 | z1 | |
|
||||
| swap1.cpp:82:5:82:6 | z1 [post update] | swap1.cpp:88:10:88:11 | z1 | |
|
||||
| swap1.cpp:82:5:82:23 | ... = ... | swap1.cpp:83:13:83:17 | data1 | |
|
||||
| swap1.cpp:82:5:82:23 | ... = ... | swap1.cpp:88:13:88:17 | data1 | |
|
||||
| swap1.cpp:82:16:82:21 | call to source | swap1.cpp:82:5:82:23 | ... = ... | |
|
||||
| swap1.cpp:85:10:85:11 | ref arg z1 | swap1.cpp:88:10:88:11 | z1 | |
|
||||
| swap1.cpp:85:14:85:15 | ref arg z2 | swap1.cpp:87:10:87:11 | z2 | |
|
||||
| swap1.cpp:93:23:93:23 | x | swap1.cpp:95:5:95:5 | x | |
|
||||
| swap1.cpp:93:23:93:23 | x | swap1.cpp:97:10:97:10 | x | |
|
||||
| swap1.cpp:93:23:93:23 | x | swap1.cpp:100:19:100:19 | x | |
|
||||
| swap1.cpp:93:23:93:23 | x | swap1.cpp:103:10:103:10 | x | |
|
||||
| swap1.cpp:94:23:94:23 | y | swap1.cpp:98:10:98:10 | y | |
|
||||
| swap1.cpp:94:23:94:23 | y | swap1.cpp:100:5:100:5 | y | |
|
||||
| swap1.cpp:94:23:94:23 | y | swap1.cpp:102:10:102:10 | y | |
|
||||
| swap1.cpp:95:5:95:5 | x [post update] | swap1.cpp:97:10:97:10 | x | |
|
||||
| swap1.cpp:95:5:95:5 | x [post update] | swap1.cpp:100:19:100:19 | x | |
|
||||
| swap1.cpp:95:5:95:5 | x [post update] | swap1.cpp:103:10:103:10 | x | |
|
||||
| swap1.cpp:95:5:95:22 | ... = ... | swap1.cpp:97:12:97:16 | data1 | |
|
||||
| swap1.cpp:95:5:95:22 | ... = ... | swap1.cpp:103:12:103:16 | data1 | |
|
||||
| swap1.cpp:95:15:95:20 | call to source | swap1.cpp:95:5:95:22 | ... = ... | |
|
||||
| swap1.cpp:100:5:100:5 | ref arg y | swap1.cpp:102:10:102:10 | y | |
|
||||
| swap1.cpp:100:9:100:17 | call to move | swap1.cpp:100:5:100:5 | ref arg y | TAINT |
|
||||
| swap1.cpp:100:9:100:17 | call to move | swap1.cpp:100:7:100:7 | call to operator= | TAINT |
|
||||
| swap1.cpp:100:9:100:17 | ref arg call to move | swap1.cpp:100:19:100:19 | x [inner post update] | |
|
||||
| swap1.cpp:100:9:100:17 | ref arg call to move | swap1.cpp:103:10:103:10 | x | |
|
||||
| swap1.cpp:100:19:100:19 | x | swap1.cpp:100:5:100:5 | ref arg y | TAINT |
|
||||
| swap1.cpp:100:19:100:19 | x | swap1.cpp:100:7:100:7 | call to operator= | TAINT |
|
||||
| swap1.cpp:100:19:100:19 | x | swap1.cpp:100:9:100:17 | call to move | |
|
||||
| swap1.cpp:108:23:108:31 | move_from | swap1.cpp:109:5:109:13 | move_from | |
|
||||
| swap1.cpp:108:23:108:31 | move_from | swap1.cpp:111:10:111:18 | move_from | |
|
||||
| swap1.cpp:108:23:108:31 | move_from | swap1.cpp:113:41:113:49 | move_from | |
|
||||
| swap1.cpp:109:5:109:13 | move_from [post update] | swap1.cpp:111:10:111:18 | move_from | |
|
||||
| swap1.cpp:109:5:109:13 | move_from [post update] | swap1.cpp:113:41:113:49 | move_from | |
|
||||
| swap1.cpp:109:5:109:30 | ... = ... | swap1.cpp:111:20:111:24 | data1 | |
|
||||
| swap1.cpp:109:5:109:30 | ... = ... | swap1.cpp:115:18:115:22 | data1 | |
|
||||
| swap1.cpp:109:23:109:28 | call to source | swap1.cpp:109:5:109:30 | ... = ... | |
|
||||
| swap1.cpp:113:31:113:39 | call to move | swap1.cpp:113:31:113:51 | call to Class | |
|
||||
| swap1.cpp:113:31:113:39 | ref arg call to move | swap1.cpp:113:41:113:49 | move_from [inner post update] | |
|
||||
| swap1.cpp:113:31:113:51 | call to Class | swap1.cpp:115:10:115:16 | move_to | |
|
||||
| swap1.cpp:113:41:113:49 | move_from | swap1.cpp:113:31:113:39 | call to move | |
|
||||
| swap1.cpp:120:23:120:23 | x | swap1.cpp:122:5:122:5 | x | |
|
||||
| swap1.cpp:120:23:120:23 | x | swap1.cpp:124:10:124:10 | x | |
|
||||
| swap1.cpp:120:23:120:23 | x | swap1.cpp:127:19:127:19 | x | |
|
||||
| swap1.cpp:120:23:120:23 | x | swap1.cpp:130:10:130:10 | x | |
|
||||
| swap1.cpp:121:23:121:23 | y | swap1.cpp:125:10:125:10 | y | |
|
||||
| swap1.cpp:121:23:121:23 | y | swap1.cpp:127:5:127:5 | y | |
|
||||
| swap1.cpp:121:23:121:23 | y | swap1.cpp:129:10:129:10 | y | |
|
||||
| swap1.cpp:122:5:122:5 | x [post update] | swap1.cpp:124:10:124:10 | x | |
|
||||
| swap1.cpp:122:5:122:5 | x [post update] | swap1.cpp:127:19:127:19 | x | |
|
||||
| swap1.cpp:122:5:122:5 | x [post update] | swap1.cpp:130:10:130:10 | x | |
|
||||
| swap1.cpp:122:5:122:22 | ... = ... | swap1.cpp:124:12:124:16 | data1 | |
|
||||
| swap1.cpp:122:5:122:22 | ... = ... | swap1.cpp:130:12:130:16 | data1 | |
|
||||
| swap1.cpp:122:15:122:20 | call to source | swap1.cpp:122:5:122:22 | ... = ... | |
|
||||
| swap1.cpp:127:5:127:5 | ref arg y | swap1.cpp:129:10:129:10 | y | |
|
||||
| swap1.cpp:135:23:135:23 | x | swap1.cpp:137:5:137:5 | x | |
|
||||
| swap1.cpp:135:23:135:23 | x | swap1.cpp:139:10:139:10 | x | |
|
||||
| swap1.cpp:135:23:135:23 | x | swap1.cpp:142:29:142:29 | x | |
|
||||
| swap1.cpp:135:23:135:23 | x | swap1.cpp:145:10:145:10 | x | |
|
||||
| swap1.cpp:136:23:136:23 | y | swap1.cpp:140:10:140:10 | y | |
|
||||
| swap1.cpp:136:23:136:23 | y | swap1.cpp:142:5:142:5 | y | |
|
||||
| swap1.cpp:136:23:136:23 | y | swap1.cpp:144:10:144:10 | y | |
|
||||
| swap1.cpp:137:5:137:5 | x [post update] | swap1.cpp:139:10:139:10 | x | |
|
||||
| swap1.cpp:137:5:137:5 | x [post update] | swap1.cpp:142:29:142:29 | x | |
|
||||
| swap1.cpp:137:5:137:5 | x [post update] | swap1.cpp:145:10:145:10 | x | |
|
||||
| swap1.cpp:137:5:137:22 | ... = ... | swap1.cpp:139:12:139:16 | data1 | |
|
||||
| swap1.cpp:137:5:137:22 | ... = ... | swap1.cpp:145:12:145:16 | data1 | |
|
||||
| swap1.cpp:137:15:137:20 | call to source | swap1.cpp:137:5:137:22 | ... = ... | |
|
||||
| swap1.cpp:142:5:142:5 | ref arg y | swap1.cpp:144:10:144:10 | y | |
|
||||
| swap1.cpp:142:19:142:27 | ref arg call to move | swap1.cpp:142:29:142:29 | x [inner post update] | |
|
||||
| swap1.cpp:142:19:142:27 | ref arg call to move | swap1.cpp:145:10:145:10 | x | |
|
||||
| swap1.cpp:142:29:142:29 | x | swap1.cpp:142:19:142:27 | call to move | |
|
||||
| swap2.cpp:14:17:14:17 | t | swap2.cpp:14:17:14:17 | t | |
|
||||
| swap2.cpp:14:17:14:17 | t | swap2.cpp:14:17:14:17 | t | |
|
||||
| swap2.cpp:14:17:14:17 | t | swap2.cpp:14:56:14:56 | t | |
|
||||
@@ -578,96 +623,141 @@
|
||||
| swap2.cpp:36:13:36:16 | this | swap2.cpp:37:21:37:24 | this | |
|
||||
| swap2.cpp:36:18:36:21 | ref arg that | swap2.cpp:34:34:34:37 | that | |
|
||||
| swap2.cpp:37:21:37:24 | this | swap2.cpp:37:20:37:24 | * ... | TAINT |
|
||||
| swap2.cpp:40:14:40:17 | this | swap2.cpp:43:18:43:22 | this | |
|
||||
| swap2.cpp:40:26:40:29 | that | swap2.cpp:40:26:40:29 | that | |
|
||||
| swap2.cpp:40:26:40:29 | that | swap2.cpp:43:25:43:28 | that | |
|
||||
| swap2.cpp:40:26:40:29 | that | swap2.cpp:43:50:43:53 | that | |
|
||||
| swap2.cpp:43:18:43:22 | data1 | swap2.cpp:43:30:43:34 | ref arg data1 | |
|
||||
| swap2.cpp:43:18:43:22 | this | swap2.cpp:43:43:43:47 | this | |
|
||||
| swap2.cpp:43:18:43:22 | this [post update] | swap2.cpp:43:43:43:47 | this | |
|
||||
| swap2.cpp:43:25:43:28 | that | swap2.cpp:43:18:43:22 | ref arg data1 | |
|
||||
| swap2.cpp:43:25:43:28 | that [post update] | swap2.cpp:40:26:40:29 | that | |
|
||||
| swap2.cpp:43:25:43:28 | that [post update] | swap2.cpp:43:50:43:53 | that | |
|
||||
| swap2.cpp:43:30:43:34 | data1 | swap2.cpp:43:18:43:22 | ref arg data1 | |
|
||||
| swap2.cpp:43:43:43:47 | data2 | swap2.cpp:43:55:43:59 | ref arg data2 | |
|
||||
| swap2.cpp:43:50:43:53 | that | swap2.cpp:43:43:43:47 | ref arg data2 | |
|
||||
| swap2.cpp:43:50:43:53 | that [post update] | swap2.cpp:40:26:40:29 | that | |
|
||||
| swap2.cpp:43:55:43:59 | data2 | swap2.cpp:43:43:43:47 | ref arg data2 | |
|
||||
| swap2.cpp:48:22:48:22 | x | swap1.cpp:48:22:48:22 | x | |
|
||||
| swap2.cpp:48:22:48:22 | x | swap1.cpp:50:9:50:9 | x | |
|
||||
| swap2.cpp:48:22:48:22 | x | swap2.cpp:48:22:48:22 | x | |
|
||||
| swap2.cpp:48:22:48:22 | x | swap2.cpp:50:9:50:9 | x | |
|
||||
| swap2.cpp:48:32:48:32 | y | swap1.cpp:48:32:48:32 | y | |
|
||||
| swap2.cpp:48:32:48:32 | y | swap1.cpp:50:16:50:16 | y | |
|
||||
| swap2.cpp:48:32:48:32 | y | swap2.cpp:48:32:48:32 | y | |
|
||||
| swap2.cpp:48:32:48:32 | y | swap2.cpp:50:16:50:16 | y | |
|
||||
| swap2.cpp:50:9:50:9 | ref arg x | swap1.cpp:48:22:48:22 | x | |
|
||||
| swap2.cpp:50:9:50:9 | ref arg x | swap2.cpp:48:22:48:22 | x | |
|
||||
| swap2.cpp:50:16:50:16 | ref arg y | swap1.cpp:48:32:48:32 | y | |
|
||||
| swap2.cpp:50:16:50:16 | ref arg y | swap2.cpp:48:32:48:32 | y | |
|
||||
| swap2.cpp:56:23:56:23 | x | swap2.cpp:58:5:58:5 | x | |
|
||||
| swap2.cpp:56:23:56:23 | x | swap2.cpp:60:10:60:10 | x | |
|
||||
| swap2.cpp:56:23:56:23 | x | swap2.cpp:63:9:63:9 | x | |
|
||||
| swap2.cpp:56:23:56:23 | x | swap2.cpp:66:10:66:10 | x | |
|
||||
| swap2.cpp:57:23:57:23 | y | swap2.cpp:61:10:61:10 | y | |
|
||||
| swap2.cpp:57:23:57:23 | y | swap2.cpp:63:5:63:5 | y | |
|
||||
| swap2.cpp:57:23:57:23 | y | swap2.cpp:65:10:65:10 | y | |
|
||||
| swap2.cpp:58:5:58:5 | x [post update] | swap2.cpp:60:10:60:10 | x | |
|
||||
| swap2.cpp:58:5:58:5 | x [post update] | swap2.cpp:63:9:63:9 | x | |
|
||||
| swap2.cpp:58:5:58:5 | x [post update] | swap2.cpp:66:10:66:10 | x | |
|
||||
| swap2.cpp:58:5:58:22 | ... = ... | swap2.cpp:60:12:60:16 | data1 | |
|
||||
| swap2.cpp:58:5:58:22 | ... = ... | swap2.cpp:66:12:66:16 | data1 | |
|
||||
| swap2.cpp:58:15:58:20 | call to source | swap2.cpp:58:5:58:22 | ... = ... | |
|
||||
| swap2.cpp:63:5:63:5 | ref arg y | swap2.cpp:65:10:65:10 | y | |
|
||||
| swap2.cpp:63:9:63:9 | x | swap2.cpp:63:5:63:5 | ref arg y | TAINT |
|
||||
| swap2.cpp:63:9:63:9 | x | swap2.cpp:63:7:63:7 | call to operator= | TAINT |
|
||||
| swap2.cpp:68:23:68:24 | z1 | swap2.cpp:69:5:69:6 | z1 | |
|
||||
| swap2.cpp:68:23:68:24 | z1 | swap2.cpp:70:10:70:11 | z1 | |
|
||||
| swap2.cpp:68:23:68:24 | z1 | swap2.cpp:72:10:72:11 | z1 | |
|
||||
| swap2.cpp:68:23:68:24 | z1 | swap2.cpp:75:10:75:11 | z1 | |
|
||||
| swap2.cpp:68:27:68:28 | z2 | swap2.cpp:72:14:72:15 | z2 | |
|
||||
| swap2.cpp:68:27:68:28 | z2 | swap2.cpp:74:10:74:11 | z2 | |
|
||||
| swap2.cpp:69:5:69:6 | z1 [post update] | swap2.cpp:70:10:70:11 | z1 | |
|
||||
| swap2.cpp:69:5:69:6 | z1 [post update] | swap2.cpp:72:10:72:11 | z1 | |
|
||||
| swap2.cpp:69:5:69:6 | z1 [post update] | swap2.cpp:75:10:75:11 | z1 | |
|
||||
| swap2.cpp:69:5:69:23 | ... = ... | swap2.cpp:70:13:70:17 | data1 | |
|
||||
| swap2.cpp:69:5:69:23 | ... = ... | swap2.cpp:75:13:75:17 | data1 | |
|
||||
| swap2.cpp:69:16:69:21 | call to source | swap2.cpp:69:5:69:23 | ... = ... | |
|
||||
| swap2.cpp:72:10:72:11 | ref arg z1 | swap2.cpp:75:10:75:11 | z1 | |
|
||||
| swap2.cpp:72:14:72:15 | ref arg z2 | swap2.cpp:74:10:74:11 | z2 | |
|
||||
| swap2.cpp:80:23:80:23 | x | swap2.cpp:82:5:82:5 | x | |
|
||||
| swap2.cpp:80:23:80:23 | x | swap2.cpp:84:10:84:10 | x | |
|
||||
| swap2.cpp:80:23:80:23 | x | swap2.cpp:87:19:87:19 | x | |
|
||||
| swap2.cpp:80:23:80:23 | x | swap2.cpp:90:10:90:10 | x | |
|
||||
| swap2.cpp:81:23:81:23 | y | swap2.cpp:85:10:85:10 | y | |
|
||||
| swap2.cpp:81:23:81:23 | y | swap2.cpp:87:5:87:5 | y | |
|
||||
| swap2.cpp:81:23:81:23 | y | swap2.cpp:89:10:89:10 | y | |
|
||||
| swap2.cpp:82:5:82:5 | x [post update] | swap2.cpp:84:10:84:10 | x | |
|
||||
| swap2.cpp:82:5:82:5 | x [post update] | swap2.cpp:87:19:87:19 | x | |
|
||||
| swap2.cpp:82:5:82:5 | x [post update] | swap2.cpp:90:10:90:10 | x | |
|
||||
| swap2.cpp:82:5:82:22 | ... = ... | swap2.cpp:84:12:84:16 | data1 | |
|
||||
| swap2.cpp:82:5:82:22 | ... = ... | swap2.cpp:90:12:90:16 | data1 | |
|
||||
| swap2.cpp:82:15:82:20 | call to source | swap2.cpp:82:5:82:22 | ... = ... | |
|
||||
| swap2.cpp:87:5:87:5 | ref arg y | swap2.cpp:89:10:89:10 | y | |
|
||||
| swap2.cpp:87:9:87:17 | call to move | swap2.cpp:87:5:87:5 | ref arg y | TAINT |
|
||||
| swap2.cpp:87:9:87:17 | call to move | swap2.cpp:87:7:87:7 | call to operator= | TAINT |
|
||||
| swap2.cpp:87:9:87:17 | ref arg call to move | swap2.cpp:87:19:87:19 | x [inner post update] | |
|
||||
| swap2.cpp:87:9:87:17 | ref arg call to move | swap2.cpp:90:10:90:10 | x | |
|
||||
| swap2.cpp:87:19:87:19 | x | swap2.cpp:87:5:87:5 | ref arg y | TAINT |
|
||||
| swap2.cpp:87:19:87:19 | x | swap2.cpp:87:7:87:7 | call to operator= | TAINT |
|
||||
| swap2.cpp:87:19:87:19 | x | swap2.cpp:87:9:87:17 | call to move | |
|
||||
| swap2.cpp:95:23:95:31 | move_from | swap2.cpp:96:5:96:13 | move_from | |
|
||||
| swap2.cpp:95:23:95:31 | move_from | swap2.cpp:98:10:98:18 | move_from | |
|
||||
| swap2.cpp:95:23:95:31 | move_from | swap2.cpp:100:41:100:49 | move_from | |
|
||||
| swap2.cpp:96:5:96:13 | move_from [post update] | swap2.cpp:98:10:98:18 | move_from | |
|
||||
| swap2.cpp:96:5:96:13 | move_from [post update] | swap2.cpp:100:41:100:49 | move_from | |
|
||||
| swap2.cpp:96:5:96:30 | ... = ... | swap2.cpp:98:20:98:24 | data1 | |
|
||||
| swap2.cpp:96:5:96:30 | ... = ... | swap2.cpp:102:18:102:22 | data1 | |
|
||||
| swap2.cpp:96:23:96:28 | call to source | swap2.cpp:96:5:96:30 | ... = ... | |
|
||||
| swap2.cpp:100:31:100:39 | call to move | swap2.cpp:100:31:100:51 | call to Class | |
|
||||
| swap2.cpp:100:31:100:39 | ref arg call to move | swap2.cpp:100:41:100:49 | move_from [inner post update] | |
|
||||
| swap2.cpp:100:31:100:51 | call to Class | swap2.cpp:102:10:102:16 | move_to | |
|
||||
| swap2.cpp:100:41:100:49 | move_from | swap2.cpp:100:31:100:39 | call to move | |
|
||||
| swap2.cpp:40:16:40:26 | this | swap2.cpp:43:13:43:16 | this | |
|
||||
| swap2.cpp:40:41:40:44 | that | swap2.cpp:42:24:42:27 | that | |
|
||||
| swap2.cpp:42:23:42:27 | call to Class | swap2.cpp:43:18:43:20 | tmp | |
|
||||
| swap2.cpp:42:24:42:27 | that | swap2.cpp:42:23:42:27 | call to Class | |
|
||||
| swap2.cpp:43:13:43:16 | ref arg this | swap2.cpp:44:21:44:24 | this | |
|
||||
| swap2.cpp:43:13:43:16 | this | swap2.cpp:44:21:44:24 | this | |
|
||||
| swap2.cpp:44:21:44:24 | this | swap2.cpp:44:20:44:24 | * ... | TAINT |
|
||||
| swap2.cpp:47:16:47:26 | this | swap2.cpp:49:13:49:16 | this | |
|
||||
| swap2.cpp:47:36:47:39 | that | swap2.cpp:47:36:47:39 | that | |
|
||||
| swap2.cpp:47:36:47:39 | that | swap2.cpp:49:18:49:21 | that | |
|
||||
| swap2.cpp:49:13:49:16 | ref arg this | swap2.cpp:50:21:50:24 | this | |
|
||||
| swap2.cpp:49:13:49:16 | this | swap2.cpp:50:21:50:24 | this | |
|
||||
| swap2.cpp:49:18:49:21 | ref arg that | swap2.cpp:47:36:47:39 | that | |
|
||||
| swap2.cpp:50:21:50:24 | this | swap2.cpp:50:20:50:24 | * ... | TAINT |
|
||||
| swap2.cpp:53:14:53:17 | this | swap2.cpp:56:18:56:22 | this | |
|
||||
| swap2.cpp:53:26:53:29 | that | swap2.cpp:53:26:53:29 | that | |
|
||||
| swap2.cpp:53:26:53:29 | that | swap2.cpp:56:25:56:28 | that | |
|
||||
| swap2.cpp:53:26:53:29 | that | swap2.cpp:56:50:56:53 | that | |
|
||||
| swap2.cpp:56:18:56:22 | data1 | swap2.cpp:56:30:56:34 | ref arg data1 | |
|
||||
| swap2.cpp:56:18:56:22 | this | swap2.cpp:56:43:56:47 | this | |
|
||||
| swap2.cpp:56:18:56:22 | this [post update] | swap2.cpp:56:43:56:47 | this | |
|
||||
| swap2.cpp:56:25:56:28 | that | swap2.cpp:56:18:56:22 | ref arg data1 | |
|
||||
| swap2.cpp:56:25:56:28 | that [post update] | swap2.cpp:53:26:53:29 | that | |
|
||||
| swap2.cpp:56:25:56:28 | that [post update] | swap2.cpp:56:50:56:53 | that | |
|
||||
| swap2.cpp:56:30:56:34 | data1 | swap2.cpp:56:18:56:22 | ref arg data1 | |
|
||||
| swap2.cpp:56:43:56:47 | data2 | swap2.cpp:56:55:56:59 | ref arg data2 | |
|
||||
| swap2.cpp:56:50:56:53 | that | swap2.cpp:56:43:56:47 | ref arg data2 | |
|
||||
| swap2.cpp:56:50:56:53 | that [post update] | swap2.cpp:53:26:53:29 | that | |
|
||||
| swap2.cpp:56:55:56:59 | data2 | swap2.cpp:56:43:56:47 | ref arg data2 | |
|
||||
| swap2.cpp:61:22:61:22 | x | swap1.cpp:61:22:61:22 | x | |
|
||||
| swap2.cpp:61:22:61:22 | x | swap1.cpp:63:9:63:9 | x | |
|
||||
| swap2.cpp:61:22:61:22 | x | swap2.cpp:61:22:61:22 | x | |
|
||||
| swap2.cpp:61:22:61:22 | x | swap2.cpp:63:9:63:9 | x | |
|
||||
| swap2.cpp:61:32:61:32 | y | swap1.cpp:61:32:61:32 | y | |
|
||||
| swap2.cpp:61:32:61:32 | y | swap1.cpp:63:16:63:16 | y | |
|
||||
| swap2.cpp:61:32:61:32 | y | swap2.cpp:61:32:61:32 | y | |
|
||||
| swap2.cpp:61:32:61:32 | y | swap2.cpp:63:16:63:16 | y | |
|
||||
| swap2.cpp:63:9:63:9 | ref arg x | swap1.cpp:61:22:61:22 | x | |
|
||||
| swap2.cpp:63:9:63:9 | ref arg x | swap2.cpp:61:22:61:22 | x | |
|
||||
| swap2.cpp:63:16:63:16 | ref arg y | swap1.cpp:61:32:61:32 | y | |
|
||||
| swap2.cpp:63:16:63:16 | ref arg y | swap2.cpp:61:32:61:32 | y | |
|
||||
| swap2.cpp:69:23:69:23 | x | swap2.cpp:71:5:71:5 | x | |
|
||||
| swap2.cpp:69:23:69:23 | x | swap2.cpp:73:10:73:10 | x | |
|
||||
| swap2.cpp:69:23:69:23 | x | swap2.cpp:76:9:76:9 | x | |
|
||||
| swap2.cpp:69:23:69:23 | x | swap2.cpp:79:10:79:10 | x | |
|
||||
| swap2.cpp:70:23:70:23 | y | swap2.cpp:74:10:74:10 | y | |
|
||||
| swap2.cpp:70:23:70:23 | y | swap2.cpp:76:5:76:5 | y | |
|
||||
| swap2.cpp:70:23:70:23 | y | swap2.cpp:78:10:78:10 | y | |
|
||||
| swap2.cpp:71:5:71:5 | x [post update] | swap2.cpp:73:10:73:10 | x | |
|
||||
| swap2.cpp:71:5:71:5 | x [post update] | swap2.cpp:76:9:76:9 | x | |
|
||||
| swap2.cpp:71:5:71:5 | x [post update] | swap2.cpp:79:10:79:10 | x | |
|
||||
| swap2.cpp:71:5:71:22 | ... = ... | swap2.cpp:73:12:73:16 | data1 | |
|
||||
| swap2.cpp:71:5:71:22 | ... = ... | swap2.cpp:79:12:79:16 | data1 | |
|
||||
| swap2.cpp:71:15:71:20 | call to source | swap2.cpp:71:5:71:22 | ... = ... | |
|
||||
| swap2.cpp:76:5:76:5 | ref arg y | swap2.cpp:78:10:78:10 | y | |
|
||||
| swap2.cpp:76:9:76:9 | x | swap2.cpp:76:5:76:5 | ref arg y | TAINT |
|
||||
| swap2.cpp:76:9:76:9 | x | swap2.cpp:76:7:76:7 | call to operator= | TAINT |
|
||||
| swap2.cpp:81:23:81:24 | z1 | swap2.cpp:82:5:82:6 | z1 | |
|
||||
| swap2.cpp:81:23:81:24 | z1 | swap2.cpp:83:10:83:11 | z1 | |
|
||||
| swap2.cpp:81:23:81:24 | z1 | swap2.cpp:85:10:85:11 | z1 | |
|
||||
| swap2.cpp:81:23:81:24 | z1 | swap2.cpp:88:10:88:11 | z1 | |
|
||||
| swap2.cpp:81:27:81:28 | z2 | swap2.cpp:85:14:85:15 | z2 | |
|
||||
| swap2.cpp:81:27:81:28 | z2 | swap2.cpp:87:10:87:11 | z2 | |
|
||||
| swap2.cpp:82:5:82:6 | z1 [post update] | swap2.cpp:83:10:83:11 | z1 | |
|
||||
| swap2.cpp:82:5:82:6 | z1 [post update] | swap2.cpp:85:10:85:11 | z1 | |
|
||||
| swap2.cpp:82:5:82:6 | z1 [post update] | swap2.cpp:88:10:88:11 | z1 | |
|
||||
| swap2.cpp:82:5:82:23 | ... = ... | swap2.cpp:83:13:83:17 | data1 | |
|
||||
| swap2.cpp:82:5:82:23 | ... = ... | swap2.cpp:88:13:88:17 | data1 | |
|
||||
| swap2.cpp:82:16:82:21 | call to source | swap2.cpp:82:5:82:23 | ... = ... | |
|
||||
| swap2.cpp:85:10:85:11 | ref arg z1 | swap2.cpp:88:10:88:11 | z1 | |
|
||||
| swap2.cpp:85:14:85:15 | ref arg z2 | swap2.cpp:87:10:87:11 | z2 | |
|
||||
| swap2.cpp:93:23:93:23 | x | swap2.cpp:95:5:95:5 | x | |
|
||||
| swap2.cpp:93:23:93:23 | x | swap2.cpp:97:10:97:10 | x | |
|
||||
| swap2.cpp:93:23:93:23 | x | swap2.cpp:100:19:100:19 | x | |
|
||||
| swap2.cpp:93:23:93:23 | x | swap2.cpp:103:10:103:10 | x | |
|
||||
| swap2.cpp:94:23:94:23 | y | swap2.cpp:98:10:98:10 | y | |
|
||||
| swap2.cpp:94:23:94:23 | y | swap2.cpp:100:5:100:5 | y | |
|
||||
| swap2.cpp:94:23:94:23 | y | swap2.cpp:102:10:102:10 | y | |
|
||||
| swap2.cpp:95:5:95:5 | x [post update] | swap2.cpp:97:10:97:10 | x | |
|
||||
| swap2.cpp:95:5:95:5 | x [post update] | swap2.cpp:100:19:100:19 | x | |
|
||||
| swap2.cpp:95:5:95:5 | x [post update] | swap2.cpp:103:10:103:10 | x | |
|
||||
| swap2.cpp:95:5:95:22 | ... = ... | swap2.cpp:97:12:97:16 | data1 | |
|
||||
| swap2.cpp:95:5:95:22 | ... = ... | swap2.cpp:103:12:103:16 | data1 | |
|
||||
| swap2.cpp:95:15:95:20 | call to source | swap2.cpp:95:5:95:22 | ... = ... | |
|
||||
| swap2.cpp:100:5:100:5 | ref arg y | swap2.cpp:102:10:102:10 | y | |
|
||||
| swap2.cpp:100:9:100:17 | call to move | swap2.cpp:100:5:100:5 | ref arg y | TAINT |
|
||||
| swap2.cpp:100:9:100:17 | call to move | swap2.cpp:100:7:100:7 | call to operator= | TAINT |
|
||||
| swap2.cpp:100:9:100:17 | ref arg call to move | swap2.cpp:100:19:100:19 | x [inner post update] | |
|
||||
| swap2.cpp:100:9:100:17 | ref arg call to move | swap2.cpp:103:10:103:10 | x | |
|
||||
| swap2.cpp:100:19:100:19 | x | swap2.cpp:100:5:100:5 | ref arg y | TAINT |
|
||||
| swap2.cpp:100:19:100:19 | x | swap2.cpp:100:7:100:7 | call to operator= | TAINT |
|
||||
| swap2.cpp:100:19:100:19 | x | swap2.cpp:100:9:100:17 | call to move | |
|
||||
| swap2.cpp:108:23:108:31 | move_from | swap2.cpp:109:5:109:13 | move_from | |
|
||||
| swap2.cpp:108:23:108:31 | move_from | swap2.cpp:111:10:111:18 | move_from | |
|
||||
| swap2.cpp:108:23:108:31 | move_from | swap2.cpp:113:41:113:49 | move_from | |
|
||||
| swap2.cpp:109:5:109:13 | move_from [post update] | swap2.cpp:111:10:111:18 | move_from | |
|
||||
| swap2.cpp:109:5:109:13 | move_from [post update] | swap2.cpp:113:41:113:49 | move_from | |
|
||||
| swap2.cpp:109:5:109:30 | ... = ... | swap2.cpp:111:20:111:24 | data1 | |
|
||||
| swap2.cpp:109:5:109:30 | ... = ... | swap2.cpp:115:18:115:22 | data1 | |
|
||||
| swap2.cpp:109:23:109:28 | call to source | swap2.cpp:109:5:109:30 | ... = ... | |
|
||||
| swap2.cpp:113:31:113:39 | call to move | swap2.cpp:113:31:113:51 | call to Class | |
|
||||
| swap2.cpp:113:31:113:39 | ref arg call to move | swap2.cpp:113:41:113:49 | move_from [inner post update] | |
|
||||
| swap2.cpp:113:31:113:51 | call to Class | swap2.cpp:115:10:115:16 | move_to | |
|
||||
| swap2.cpp:113:41:113:49 | move_from | swap2.cpp:113:31:113:39 | call to move | |
|
||||
| swap2.cpp:120:23:120:23 | x | swap2.cpp:122:5:122:5 | x | |
|
||||
| swap2.cpp:120:23:120:23 | x | swap2.cpp:124:10:124:10 | x | |
|
||||
| swap2.cpp:120:23:120:23 | x | swap2.cpp:127:19:127:19 | x | |
|
||||
| swap2.cpp:120:23:120:23 | x | swap2.cpp:130:10:130:10 | x | |
|
||||
| swap2.cpp:121:23:121:23 | y | swap2.cpp:125:10:125:10 | y | |
|
||||
| swap2.cpp:121:23:121:23 | y | swap2.cpp:127:5:127:5 | y | |
|
||||
| swap2.cpp:121:23:121:23 | y | swap2.cpp:129:10:129:10 | y | |
|
||||
| swap2.cpp:122:5:122:5 | x [post update] | swap2.cpp:124:10:124:10 | x | |
|
||||
| swap2.cpp:122:5:122:5 | x [post update] | swap2.cpp:127:19:127:19 | x | |
|
||||
| swap2.cpp:122:5:122:5 | x [post update] | swap2.cpp:130:10:130:10 | x | |
|
||||
| swap2.cpp:122:5:122:22 | ... = ... | swap2.cpp:124:12:124:16 | data1 | |
|
||||
| swap2.cpp:122:5:122:22 | ... = ... | swap2.cpp:130:12:130:16 | data1 | |
|
||||
| swap2.cpp:122:15:122:20 | call to source | swap2.cpp:122:5:122:22 | ... = ... | |
|
||||
| swap2.cpp:127:5:127:5 | ref arg y | swap2.cpp:129:10:129:10 | y | |
|
||||
| swap2.cpp:135:23:135:23 | x | swap2.cpp:137:5:137:5 | x | |
|
||||
| swap2.cpp:135:23:135:23 | x | swap2.cpp:139:10:139:10 | x | |
|
||||
| swap2.cpp:135:23:135:23 | x | swap2.cpp:142:29:142:29 | x | |
|
||||
| swap2.cpp:135:23:135:23 | x | swap2.cpp:145:10:145:10 | x | |
|
||||
| swap2.cpp:136:23:136:23 | y | swap2.cpp:140:10:140:10 | y | |
|
||||
| swap2.cpp:136:23:136:23 | y | swap2.cpp:142:5:142:5 | y | |
|
||||
| swap2.cpp:136:23:136:23 | y | swap2.cpp:144:10:144:10 | y | |
|
||||
| swap2.cpp:137:5:137:5 | x [post update] | swap2.cpp:139:10:139:10 | x | |
|
||||
| swap2.cpp:137:5:137:5 | x [post update] | swap2.cpp:142:29:142:29 | x | |
|
||||
| swap2.cpp:137:5:137:5 | x [post update] | swap2.cpp:145:10:145:10 | x | |
|
||||
| swap2.cpp:137:5:137:22 | ... = ... | swap2.cpp:139:12:139:16 | data1 | |
|
||||
| swap2.cpp:137:5:137:22 | ... = ... | swap2.cpp:145:12:145:16 | data1 | |
|
||||
| swap2.cpp:137:15:137:20 | call to source | swap2.cpp:137:5:137:22 | ... = ... | |
|
||||
| swap2.cpp:142:5:142:5 | ref arg y | swap2.cpp:144:10:144:10 | y | |
|
||||
| swap2.cpp:142:19:142:27 | ref arg call to move | swap2.cpp:142:29:142:29 | x [inner post update] | |
|
||||
| swap2.cpp:142:19:142:27 | ref arg call to move | swap2.cpp:145:10:145:10 | x | |
|
||||
| swap2.cpp:142:29:142:29 | x | swap2.cpp:142:19:142:27 | call to move | |
|
||||
| taint.cpp:4:27:4:33 | source1 | taint.cpp:6:13:6:19 | source1 | |
|
||||
| taint.cpp:4:40:4:45 | clean1 | taint.cpp:5:8:5:13 | clean1 | |
|
||||
| taint.cpp:4:40:4:45 | clean1 | taint.cpp:6:3:6:8 | clean1 | |
|
||||
|
||||
@@ -37,6 +37,19 @@ namespace IntWrapper
|
||||
return *this;
|
||||
}
|
||||
|
||||
Class ©_assign(const Class &that) // copy assignment without the usual signature
|
||||
{
|
||||
auto tmp = that;
|
||||
swap(tmp);
|
||||
return *this;
|
||||
}
|
||||
|
||||
Class &move_assign(Class &&that) // move assignment without the usual signature
|
||||
{
|
||||
swap(that);
|
||||
return *this;
|
||||
}
|
||||
|
||||
void swap(Class &that) noexcept
|
||||
{
|
||||
using std::swap;
|
||||
@@ -101,3 +114,33 @@ void test_move_constructor()
|
||||
|
||||
sink(move_to.data1); // tainted
|
||||
}
|
||||
|
||||
void test_copy_assignment_method()
|
||||
{
|
||||
IntWrapper::Class x;
|
||||
IntWrapper::Class y;
|
||||
x.data1 = source();
|
||||
|
||||
sink(x.data1); // tainted
|
||||
sink(y.data1); // clean
|
||||
|
||||
y.copy_assign(x);
|
||||
|
||||
sink(y.data1); // tainted
|
||||
sink(x.data1); // tainted
|
||||
}
|
||||
|
||||
void test_move_assignment_method()
|
||||
{
|
||||
IntWrapper::Class x;
|
||||
IntWrapper::Class y;
|
||||
x.data1 = source();
|
||||
|
||||
sink(x.data1); // tainted
|
||||
sink(y.data1); // clean
|
||||
|
||||
y.move_assign(std::move(x));
|
||||
|
||||
sink(y.data1); // tainted
|
||||
sink(x.data1); // tainted
|
||||
}
|
||||
|
||||
@@ -37,6 +37,19 @@ namespace IntWrapper
|
||||
return *this;
|
||||
}
|
||||
|
||||
Class ©_assign(const Class &that) // copy assignment without the usual signature
|
||||
{
|
||||
auto tmp = that;
|
||||
swap(tmp);
|
||||
return *this;
|
||||
}
|
||||
|
||||
Class &move_assign(Class &&that) // move assignment without the usual signature
|
||||
{
|
||||
swap(that);
|
||||
return *this;
|
||||
}
|
||||
|
||||
void swap(Class &that) noexcept
|
||||
{
|
||||
using std::swap;
|
||||
@@ -101,3 +114,33 @@ void test_move_constructor()
|
||||
|
||||
sink(move_to.data1); // tainted
|
||||
}
|
||||
|
||||
void test_copy_assignment_method()
|
||||
{
|
||||
IntWrapper::Class x;
|
||||
IntWrapper::Class y;
|
||||
x.data1 = source();
|
||||
|
||||
sink(x.data1); // tainted
|
||||
sink(y.data1); // clean
|
||||
|
||||
y.copy_assign(x);
|
||||
|
||||
sink(y.data1); // tainted
|
||||
sink(x.data1); // tainted
|
||||
}
|
||||
|
||||
void test_move_assignment_method()
|
||||
{
|
||||
IntWrapper::Class x;
|
||||
IntWrapper::Class y;
|
||||
x.data1 = source();
|
||||
|
||||
sink(x.data1); // tainted
|
||||
sink(y.data1); // clean
|
||||
|
||||
y.move_assign(std::move(x));
|
||||
|
||||
sink(y.data1); // tainted
|
||||
sink(x.data1); // tainted
|
||||
}
|
||||
|
||||
@@ -53,36 +53,51 @@
|
||||
| structlikeclass.cpp:60:8:60:9 | s1 | structlikeclass.cpp:55:40:55:45 | call to source |
|
||||
| structlikeclass.cpp:61:8:61:9 | s2 | structlikeclass.cpp:58:24:58:29 | call to source |
|
||||
| structlikeclass.cpp:62:8:62:20 | ... = ... | structlikeclass.cpp:62:13:62:18 | call to source |
|
||||
| swap1.cpp:60:12:60:16 | data1 | swap1.cpp:58:15:58:20 | call to source |
|
||||
| swap1.cpp:65:12:65:16 | data1 | swap1.cpp:56:23:56:23 | x |
|
||||
| swap1.cpp:65:12:65:16 | data1 | swap1.cpp:58:15:58:20 | call to source |
|
||||
| swap1.cpp:66:12:66:16 | data1 | swap1.cpp:58:15:58:20 | call to source |
|
||||
| swap1.cpp:70:13:70:17 | data1 | swap1.cpp:69:16:69:21 | call to source |
|
||||
| swap1.cpp:74:13:74:17 | data1 | swap1.cpp:69:16:69:21 | call to source |
|
||||
| swap1.cpp:75:13:75:17 | data1 | swap1.cpp:68:27:68:28 | z2 |
|
||||
| swap1.cpp:75:13:75:17 | data1 | swap1.cpp:69:16:69:21 | call to source |
|
||||
| swap1.cpp:84:12:84:16 | data1 | swap1.cpp:82:15:82:20 | call to source |
|
||||
| swap1.cpp:89:12:89:16 | data1 | swap1.cpp:80:23:80:23 | x |
|
||||
| swap1.cpp:89:12:89:16 | data1 | swap1.cpp:82:15:82:20 | call to source |
|
||||
| swap1.cpp:90:12:90:16 | data1 | swap1.cpp:82:15:82:20 | call to source |
|
||||
| swap1.cpp:98:20:98:24 | data1 | swap1.cpp:96:23:96:28 | call to source |
|
||||
| swap1.cpp:102:18:102:22 | data1 | swap1.cpp:95:23:95:31 | move_from |
|
||||
| swap1.cpp:102:18:102:22 | data1 | swap1.cpp:96:23:96:28 | call to source |
|
||||
| swap2.cpp:60:12:60:16 | data1 | swap2.cpp:58:15:58:20 | call to source |
|
||||
| swap2.cpp:65:12:65:16 | data1 | swap2.cpp:56:23:56:23 | x |
|
||||
| swap2.cpp:65:12:65:16 | data1 | swap2.cpp:58:15:58:20 | call to source |
|
||||
| swap2.cpp:66:12:66:16 | data1 | swap2.cpp:58:15:58:20 | call to source |
|
||||
| swap2.cpp:70:13:70:17 | data1 | swap2.cpp:69:16:69:21 | call to source |
|
||||
| swap2.cpp:74:13:74:17 | data1 | swap2.cpp:69:16:69:21 | call to source |
|
||||
| swap2.cpp:75:13:75:17 | data1 | swap2.cpp:68:27:68:28 | z2 |
|
||||
| swap2.cpp:75:13:75:17 | data1 | swap2.cpp:69:16:69:21 | call to source |
|
||||
| swap2.cpp:84:12:84:16 | data1 | swap2.cpp:82:15:82:20 | call to source |
|
||||
| swap2.cpp:89:12:89:16 | data1 | swap2.cpp:80:23:80:23 | x |
|
||||
| swap2.cpp:89:12:89:16 | data1 | swap2.cpp:82:15:82:20 | call to source |
|
||||
| swap2.cpp:90:12:90:16 | data1 | swap2.cpp:82:15:82:20 | call to source |
|
||||
| swap2.cpp:98:20:98:24 | data1 | swap2.cpp:96:23:96:28 | call to source |
|
||||
| swap2.cpp:102:18:102:22 | data1 | swap2.cpp:95:23:95:31 | move_from |
|
||||
| swap2.cpp:102:18:102:22 | data1 | swap2.cpp:96:23:96:28 | call to source |
|
||||
| swap1.cpp:73:12:73:16 | data1 | swap1.cpp:71:15:71:20 | call to source |
|
||||
| swap1.cpp:78:12:78:16 | data1 | swap1.cpp:69:23:69:23 | x |
|
||||
| swap1.cpp:78:12:78:16 | data1 | swap1.cpp:71:15:71:20 | call to source |
|
||||
| swap1.cpp:79:12:79:16 | data1 | swap1.cpp:71:15:71:20 | call to source |
|
||||
| swap1.cpp:83:13:83:17 | data1 | swap1.cpp:82:16:82:21 | call to source |
|
||||
| swap1.cpp:87:13:87:17 | data1 | swap1.cpp:82:16:82:21 | call to source |
|
||||
| swap1.cpp:88:13:88:17 | data1 | swap1.cpp:81:27:81:28 | z2 |
|
||||
| swap1.cpp:88:13:88:17 | data1 | swap1.cpp:82:16:82:21 | call to source |
|
||||
| swap1.cpp:97:12:97:16 | data1 | swap1.cpp:95:15:95:20 | call to source |
|
||||
| swap1.cpp:102:12:102:16 | data1 | swap1.cpp:93:23:93:23 | x |
|
||||
| swap1.cpp:102:12:102:16 | data1 | swap1.cpp:95:15:95:20 | call to source |
|
||||
| swap1.cpp:103:12:103:16 | data1 | swap1.cpp:95:15:95:20 | call to source |
|
||||
| swap1.cpp:111:20:111:24 | data1 | swap1.cpp:109:23:109:28 | call to source |
|
||||
| swap1.cpp:115:18:115:22 | data1 | swap1.cpp:108:23:108:31 | move_from |
|
||||
| swap1.cpp:115:18:115:22 | data1 | swap1.cpp:109:23:109:28 | call to source |
|
||||
| swap1.cpp:124:12:124:16 | data1 | swap1.cpp:122:15:122:20 | call to source |
|
||||
| swap1.cpp:129:12:129:16 | data1 | swap1.cpp:120:23:120:23 | x |
|
||||
| swap1.cpp:129:12:129:16 | data1 | swap1.cpp:122:15:122:20 | call to source |
|
||||
| swap1.cpp:130:12:130:16 | data1 | swap1.cpp:122:15:122:20 | call to source |
|
||||
| swap1.cpp:139:12:139:16 | data1 | swap1.cpp:137:15:137:20 | call to source |
|
||||
| swap1.cpp:144:12:144:16 | data1 | swap1.cpp:135:23:135:23 | x |
|
||||
| swap1.cpp:144:12:144:16 | data1 | swap1.cpp:137:15:137:20 | call to source |
|
||||
| swap1.cpp:145:12:145:16 | data1 | swap1.cpp:137:15:137:20 | call to source |
|
||||
| swap2.cpp:73:12:73:16 | data1 | swap2.cpp:71:15:71:20 | call to source |
|
||||
| swap2.cpp:78:12:78:16 | data1 | swap2.cpp:69:23:69:23 | x |
|
||||
| swap2.cpp:78:12:78:16 | data1 | swap2.cpp:71:15:71:20 | call to source |
|
||||
| swap2.cpp:79:12:79:16 | data1 | swap2.cpp:71:15:71:20 | call to source |
|
||||
| swap2.cpp:83:13:83:17 | data1 | swap2.cpp:82:16:82:21 | call to source |
|
||||
| swap2.cpp:88:13:88:17 | data1 | swap2.cpp:81:27:81:28 | z2 |
|
||||
| swap2.cpp:88:13:88:17 | data1 | swap2.cpp:82:16:82:21 | call to source |
|
||||
| swap2.cpp:97:12:97:16 | data1 | swap2.cpp:95:15:95:20 | call to source |
|
||||
| swap2.cpp:102:12:102:16 | data1 | swap2.cpp:93:23:93:23 | x |
|
||||
| swap2.cpp:102:12:102:16 | data1 | swap2.cpp:95:15:95:20 | call to source |
|
||||
| swap2.cpp:103:12:103:16 | data1 | swap2.cpp:95:15:95:20 | call to source |
|
||||
| swap2.cpp:111:20:111:24 | data1 | swap2.cpp:109:23:109:28 | call to source |
|
||||
| swap2.cpp:115:18:115:22 | data1 | swap2.cpp:108:23:108:31 | move_from |
|
||||
| swap2.cpp:115:18:115:22 | data1 | swap2.cpp:109:23:109:28 | call to source |
|
||||
| swap2.cpp:124:12:124:16 | data1 | swap2.cpp:122:15:122:20 | call to source |
|
||||
| swap2.cpp:129:12:129:16 | data1 | swap2.cpp:120:23:120:23 | x |
|
||||
| swap2.cpp:129:12:129:16 | data1 | swap2.cpp:122:15:122:20 | call to source |
|
||||
| swap2.cpp:130:12:130:16 | data1 | swap2.cpp:122:15:122:20 | call to source |
|
||||
| swap2.cpp:139:12:139:16 | data1 | swap2.cpp:137:15:137:20 | call to source |
|
||||
| swap2.cpp:144:12:144:16 | data1 | swap2.cpp:135:23:135:23 | x |
|
||||
| swap2.cpp:144:12:144:16 | data1 | swap2.cpp:137:15:137:20 | call to source |
|
||||
| swap2.cpp:145:12:145:16 | data1 | swap2.cpp:137:15:137:20 | call to source |
|
||||
| taint.cpp:8:8:8:13 | clean1 | taint.cpp:4:27:4:33 | source1 |
|
||||
| taint.cpp:16:8:16:14 | source1 | taint.cpp:12:22:12:27 | call to source |
|
||||
| taint.cpp:17:8:17:16 | ++ ... | taint.cpp:12:22:12:27 | call to source |
|
||||
|
||||
@@ -47,16 +47,19 @@
|
||||
| structlikeclass.cpp:36:8:36:9 | structlikeclass.cpp:30:24:30:29 | AST only |
|
||||
| structlikeclass.cpp:37:8:37:9 | structlikeclass.cpp:29:22:29:27 | AST only |
|
||||
| structlikeclass.cpp:60:8:60:9 | structlikeclass.cpp:55:40:55:45 | AST only |
|
||||
| swap1.cpp:65:12:65:16 | swap1.cpp:56:23:56:23 | AST only |
|
||||
| swap1.cpp:74:13:74:17 | swap1.cpp:69:16:69:21 | AST only |
|
||||
| swap1.cpp:75:13:75:17 | swap1.cpp:68:27:68:28 | AST only |
|
||||
| swap1.cpp:89:12:89:16 | swap1.cpp:80:23:80:23 | AST only |
|
||||
| swap1.cpp:102:18:102:22 | swap1.cpp:95:23:95:31 | AST only |
|
||||
| swap2.cpp:65:12:65:16 | swap2.cpp:56:23:56:23 | AST only |
|
||||
| swap2.cpp:74:13:74:17 | swap2.cpp:69:16:69:21 | AST only |
|
||||
| swap2.cpp:75:13:75:17 | swap2.cpp:68:27:68:28 | AST only |
|
||||
| swap2.cpp:89:12:89:16 | swap2.cpp:80:23:80:23 | AST only |
|
||||
| swap2.cpp:102:18:102:22 | swap2.cpp:95:23:95:31 | AST only |
|
||||
| swap1.cpp:78:12:78:16 | swap1.cpp:69:23:69:23 | AST only |
|
||||
| swap1.cpp:87:13:87:17 | swap1.cpp:82:16:82:21 | AST only |
|
||||
| swap1.cpp:88:13:88:17 | swap1.cpp:81:27:81:28 | AST only |
|
||||
| swap1.cpp:102:12:102:16 | swap1.cpp:93:23:93:23 | AST only |
|
||||
| swap1.cpp:115:18:115:22 | swap1.cpp:108:23:108:31 | AST only |
|
||||
| swap1.cpp:129:12:129:16 | swap1.cpp:120:23:120:23 | AST only |
|
||||
| swap1.cpp:144:12:144:16 | swap1.cpp:135:23:135:23 | AST only |
|
||||
| swap2.cpp:78:12:78:16 | swap2.cpp:69:23:69:23 | AST only |
|
||||
| swap2.cpp:88:13:88:17 | swap2.cpp:81:27:81:28 | AST only |
|
||||
| swap2.cpp:102:12:102:16 | swap2.cpp:93:23:93:23 | AST only |
|
||||
| swap2.cpp:115:18:115:22 | swap2.cpp:108:23:108:31 | AST only |
|
||||
| swap2.cpp:129:12:129:16 | swap2.cpp:120:23:120:23 | AST only |
|
||||
| swap2.cpp:144:12:144:16 | swap2.cpp:135:23:135:23 | AST only |
|
||||
| taint.cpp:41:7:41:13 | taint.cpp:35:12:35:17 | AST only |
|
||||
| taint.cpp:42:7:42:13 | taint.cpp:35:12:35:17 | AST only |
|
||||
| taint.cpp:43:7:43:13 | taint.cpp:37:22:37:27 | AST only |
|
||||
|
||||
@@ -8,26 +8,38 @@
|
||||
| structlikeclass.cpp:38:8:38:9 | s4 | structlikeclass.cpp:33:8:33:13 | call to source |
|
||||
| structlikeclass.cpp:61:8:61:9 | s2 | structlikeclass.cpp:58:24:58:29 | call to source |
|
||||
| structlikeclass.cpp:62:8:62:20 | ... = ... | structlikeclass.cpp:62:13:62:18 | call to source |
|
||||
| swap1.cpp:60:12:60:16 | data1 | swap1.cpp:58:15:58:20 | call to source |
|
||||
| swap1.cpp:65:12:65:16 | data1 | swap1.cpp:58:15:58:20 | call to source |
|
||||
| swap1.cpp:66:12:66:16 | data1 | swap1.cpp:58:15:58:20 | call to source |
|
||||
| swap1.cpp:70:13:70:17 | data1 | swap1.cpp:69:16:69:21 | call to source |
|
||||
| swap1.cpp:75:13:75:17 | data1 | swap1.cpp:69:16:69:21 | call to source |
|
||||
| swap1.cpp:84:12:84:16 | data1 | swap1.cpp:82:15:82:20 | call to source |
|
||||
| swap1.cpp:89:12:89:16 | data1 | swap1.cpp:82:15:82:20 | call to source |
|
||||
| swap1.cpp:90:12:90:16 | data1 | swap1.cpp:82:15:82:20 | call to source |
|
||||
| swap1.cpp:98:20:98:24 | data1 | swap1.cpp:96:23:96:28 | call to source |
|
||||
| swap1.cpp:102:18:102:22 | data1 | swap1.cpp:96:23:96:28 | call to source |
|
||||
| swap2.cpp:60:12:60:16 | data1 | swap2.cpp:58:15:58:20 | call to source |
|
||||
| swap2.cpp:65:12:65:16 | data1 | swap2.cpp:58:15:58:20 | call to source |
|
||||
| swap2.cpp:66:12:66:16 | data1 | swap2.cpp:58:15:58:20 | call to source |
|
||||
| swap2.cpp:70:13:70:17 | data1 | swap2.cpp:69:16:69:21 | call to source |
|
||||
| swap2.cpp:75:13:75:17 | data1 | swap2.cpp:69:16:69:21 | call to source |
|
||||
| swap2.cpp:84:12:84:16 | data1 | swap2.cpp:82:15:82:20 | call to source |
|
||||
| swap2.cpp:89:12:89:16 | data1 | swap2.cpp:82:15:82:20 | call to source |
|
||||
| swap2.cpp:90:12:90:16 | data1 | swap2.cpp:82:15:82:20 | call to source |
|
||||
| swap2.cpp:98:20:98:24 | data1 | swap2.cpp:96:23:96:28 | call to source |
|
||||
| swap2.cpp:102:18:102:22 | data1 | swap2.cpp:96:23:96:28 | call to source |
|
||||
| swap1.cpp:73:12:73:16 | data1 | swap1.cpp:71:15:71:20 | call to source |
|
||||
| swap1.cpp:78:12:78:16 | data1 | swap1.cpp:71:15:71:20 | call to source |
|
||||
| swap1.cpp:79:12:79:16 | data1 | swap1.cpp:71:15:71:20 | call to source |
|
||||
| swap1.cpp:83:13:83:17 | data1 | swap1.cpp:82:16:82:21 | call to source |
|
||||
| swap1.cpp:88:13:88:17 | data1 | swap1.cpp:82:16:82:21 | call to source |
|
||||
| swap1.cpp:97:12:97:16 | data1 | swap1.cpp:95:15:95:20 | call to source |
|
||||
| swap1.cpp:102:12:102:16 | data1 | swap1.cpp:95:15:95:20 | call to source |
|
||||
| swap1.cpp:103:12:103:16 | data1 | swap1.cpp:95:15:95:20 | call to source |
|
||||
| swap1.cpp:111:20:111:24 | data1 | swap1.cpp:109:23:109:28 | call to source |
|
||||
| swap1.cpp:115:18:115:22 | data1 | swap1.cpp:109:23:109:28 | call to source |
|
||||
| swap1.cpp:124:12:124:16 | data1 | swap1.cpp:122:15:122:20 | call to source |
|
||||
| swap1.cpp:129:12:129:16 | data1 | swap1.cpp:122:15:122:20 | call to source |
|
||||
| swap1.cpp:130:12:130:16 | data1 | swap1.cpp:122:15:122:20 | call to source |
|
||||
| swap1.cpp:139:12:139:16 | data1 | swap1.cpp:137:15:137:20 | call to source |
|
||||
| swap1.cpp:144:12:144:16 | data1 | swap1.cpp:137:15:137:20 | call to source |
|
||||
| swap1.cpp:145:12:145:16 | data1 | swap1.cpp:137:15:137:20 | call to source |
|
||||
| swap2.cpp:73:12:73:16 | data1 | swap2.cpp:71:15:71:20 | call to source |
|
||||
| swap2.cpp:78:12:78:16 | data1 | swap2.cpp:71:15:71:20 | call to source |
|
||||
| swap2.cpp:79:12:79:16 | data1 | swap2.cpp:71:15:71:20 | call to source |
|
||||
| swap2.cpp:83:13:83:17 | data1 | swap2.cpp:82:16:82:21 | call to source |
|
||||
| swap2.cpp:88:13:88:17 | data1 | swap2.cpp:82:16:82:21 | call to source |
|
||||
| swap2.cpp:97:12:97:16 | data1 | swap2.cpp:95:15:95:20 | call to source |
|
||||
| swap2.cpp:102:12:102:16 | data1 | swap2.cpp:95:15:95:20 | call to source |
|
||||
| swap2.cpp:103:12:103:16 | data1 | swap2.cpp:95:15:95:20 | call to source |
|
||||
| swap2.cpp:111:20:111:24 | data1 | swap2.cpp:109:23:109:28 | call to source |
|
||||
| swap2.cpp:115:18:115:22 | data1 | swap2.cpp:109:23:109:28 | call to source |
|
||||
| swap2.cpp:124:12:124:16 | data1 | swap2.cpp:122:15:122:20 | call to source |
|
||||
| swap2.cpp:129:12:129:16 | data1 | swap2.cpp:122:15:122:20 | call to source |
|
||||
| swap2.cpp:130:12:130:16 | data1 | swap2.cpp:122:15:122:20 | call to source |
|
||||
| swap2.cpp:139:12:139:16 | data1 | swap2.cpp:137:15:137:20 | call to source |
|
||||
| swap2.cpp:144:12:144:16 | data1 | swap2.cpp:137:15:137:20 | call to source |
|
||||
| swap2.cpp:145:12:145:16 | data1 | swap2.cpp:137:15:137:20 | call to source |
|
||||
| taint.cpp:8:8:8:13 | clean1 | taint.cpp:4:27:4:33 | source1 |
|
||||
| taint.cpp:16:8:16:14 | source1 | taint.cpp:12:22:12:27 | call to source |
|
||||
| taint.cpp:17:8:17:16 | ++ ... | taint.cpp:12:22:12:27 | call to source |
|
||||
|
||||
@@ -440,6 +440,47 @@
|
||||
| test.c:424:3:424:3 | i | -2.147483648E9 |
|
||||
| test.c:424:13:424:13 | j | -2.147483648E9 |
|
||||
| test.c:425:7:425:7 | i | -2.147483648E9 |
|
||||
| test.c:432:12:432:12 | a | 0.0 |
|
||||
| test.c:432:17:432:17 | a | 3.0 |
|
||||
| test.c:432:33:432:33 | b | 0.0 |
|
||||
| test.c:432:38:432:38 | b | 5.0 |
|
||||
| test.c:433:13:433:13 | a | 3.0 |
|
||||
| test.c:433:15:433:15 | b | 5.0 |
|
||||
| test.c:434:5:434:9 | total | 0.0 |
|
||||
| test.c:434:14:434:14 | r | -2.147483648E9 |
|
||||
| test.c:436:12:436:12 | a | 0.0 |
|
||||
| test.c:436:17:436:17 | a | 3.0 |
|
||||
| test.c:436:33:436:33 | b | 0.0 |
|
||||
| test.c:436:38:436:38 | b | 0.0 |
|
||||
| test.c:437:13:437:13 | a | 3.0 |
|
||||
| test.c:437:15:437:15 | b | 0.0 |
|
||||
| test.c:438:5:438:9 | total | -2.147483648E9 |
|
||||
| test.c:438:14:438:14 | r | -2.147483648E9 |
|
||||
| test.c:440:12:440:12 | a | 0.0 |
|
||||
| test.c:440:17:440:17 | a | 3.0 |
|
||||
| test.c:440:34:440:34 | b | 0.0 |
|
||||
| test.c:440:39:440:39 | b | 13.0 |
|
||||
| test.c:441:13:441:13 | a | 3.0 |
|
||||
| test.c:441:15:441:15 | b | 13.0 |
|
||||
| test.c:442:5:442:9 | total | -2.147483648E9 |
|
||||
| test.c:442:14:442:14 | r | -2.147483648E9 |
|
||||
| test.c:445:10:445:14 | total | -2.147483648E9 |
|
||||
| test.c:451:12:451:12 | b | 0.0 |
|
||||
| test.c:451:17:451:17 | b | 5.0 |
|
||||
| test.c:452:16:452:16 | b | 5.0 |
|
||||
| test.c:453:5:453:9 | total | 0.0 |
|
||||
| test.c:453:14:453:14 | r | -2.147483648E9 |
|
||||
| test.c:455:12:455:12 | b | 0.0 |
|
||||
| test.c:455:17:455:17 | b | 0.0 |
|
||||
| test.c:456:16:456:16 | b | 0.0 |
|
||||
| test.c:457:5:457:9 | total | -2.147483648E9 |
|
||||
| test.c:457:14:457:14 | r | -2.147483648E9 |
|
||||
| test.c:459:13:459:13 | b | 0.0 |
|
||||
| test.c:459:18:459:18 | b | 13.0 |
|
||||
| test.c:460:16:460:16 | b | 13.0 |
|
||||
| test.c:461:5:461:9 | total | -2.147483648E9 |
|
||||
| test.c:461:14:461:14 | r | -2.147483648E9 |
|
||||
| test.c:464:10:464:14 | total | -2.147483648E9 |
|
||||
| test.cpp:10:7:10:7 | b | -2.147483648E9 |
|
||||
| test.cpp:11:5:11:5 | x | -2.147483648E9 |
|
||||
| test.cpp:13:10:13:10 | x | -2.147483648E9 |
|
||||
|
||||
@@ -424,3 +424,42 @@ void test17() {
|
||||
i = 20 + (j -= 10);
|
||||
out(i); // 60 [BUG: the analysis thinks it's 2^-31 .. 2^31-1]
|
||||
}
|
||||
|
||||
// Tests for unsigned multiplication.
|
||||
int test_unsigned_mult01(unsigned int a, unsigned b) {
|
||||
int total = 0;
|
||||
|
||||
if (3 <= a && a <= 11 && 5 <= b && b <= 23) {
|
||||
int r = a*b; // 15 .. 253
|
||||
total += r;
|
||||
}
|
||||
if (3 <= a && a <= 11 && 0 <= b && b <= 23) {
|
||||
int r = a*b; // 0 .. 253
|
||||
total += r;
|
||||
}
|
||||
if (3 <= a && a <= 11 && 13 <= b && b <= 23) {
|
||||
int r = a*b; // 39 .. 253
|
||||
total += r;
|
||||
}
|
||||
|
||||
return total;
|
||||
}
|
||||
|
||||
int test_unsigned_mult02(unsigned b) {
|
||||
int total = 0;
|
||||
|
||||
if (5 <= b && b <= 23) {
|
||||
int r = 11*b; // 55 .. 253
|
||||
total += r;
|
||||
}
|
||||
if (0 <= b && b <= 23) {
|
||||
int r = 11*b; // 0 .. 253
|
||||
total += r;
|
||||
}
|
||||
if (13 <= b && b <= 23) {
|
||||
int r = 11*b; // 143 .. 253
|
||||
total += r;
|
||||
}
|
||||
|
||||
return total;
|
||||
}
|
||||
|
||||
@@ -440,6 +440,47 @@
|
||||
| test.c:424:3:424:3 | i | 2.147483647E9 |
|
||||
| test.c:424:13:424:13 | j | 2.147483647E9 |
|
||||
| test.c:425:7:425:7 | i | 2.147483647E9 |
|
||||
| test.c:432:12:432:12 | a | 4.294967295E9 |
|
||||
| test.c:432:17:432:17 | a | 4.294967295E9 |
|
||||
| test.c:432:33:432:33 | b | 4.294967295E9 |
|
||||
| test.c:432:38:432:38 | b | 4.294967295E9 |
|
||||
| test.c:433:13:433:13 | a | 11.0 |
|
||||
| test.c:433:15:433:15 | b | 23.0 |
|
||||
| test.c:434:5:434:9 | total | 0.0 |
|
||||
| test.c:434:14:434:14 | r | 2.147483647E9 |
|
||||
| test.c:436:12:436:12 | a | 4.294967295E9 |
|
||||
| test.c:436:17:436:17 | a | 4.294967295E9 |
|
||||
| test.c:436:33:436:33 | b | 4.294967295E9 |
|
||||
| test.c:436:38:436:38 | b | 4.294967295E9 |
|
||||
| test.c:437:13:437:13 | a | 11.0 |
|
||||
| test.c:437:15:437:15 | b | 23.0 |
|
||||
| test.c:438:5:438:9 | total | 2.147483647E9 |
|
||||
| test.c:438:14:438:14 | r | 2.147483647E9 |
|
||||
| test.c:440:12:440:12 | a | 4.294967295E9 |
|
||||
| test.c:440:17:440:17 | a | 4.294967295E9 |
|
||||
| test.c:440:34:440:34 | b | 4.294967295E9 |
|
||||
| test.c:440:39:440:39 | b | 4.294967295E9 |
|
||||
| test.c:441:13:441:13 | a | 11.0 |
|
||||
| test.c:441:15:441:15 | b | 23.0 |
|
||||
| test.c:442:5:442:9 | total | 2.147483647E9 |
|
||||
| test.c:442:14:442:14 | r | 2.147483647E9 |
|
||||
| test.c:445:10:445:14 | total | 2.147483647E9 |
|
||||
| test.c:451:12:451:12 | b | 4.294967295E9 |
|
||||
| test.c:451:17:451:17 | b | 4.294967295E9 |
|
||||
| test.c:452:16:452:16 | b | 23.0 |
|
||||
| test.c:453:5:453:9 | total | 0.0 |
|
||||
| test.c:453:14:453:14 | r | 2.147483647E9 |
|
||||
| test.c:455:12:455:12 | b | 4.294967295E9 |
|
||||
| test.c:455:17:455:17 | b | 4.294967295E9 |
|
||||
| test.c:456:16:456:16 | b | 23.0 |
|
||||
| test.c:457:5:457:9 | total | 2.147483647E9 |
|
||||
| test.c:457:14:457:14 | r | 2.147483647E9 |
|
||||
| test.c:459:13:459:13 | b | 4.294967295E9 |
|
||||
| test.c:459:18:459:18 | b | 4.294967295E9 |
|
||||
| test.c:460:16:460:16 | b | 23.0 |
|
||||
| test.c:461:5:461:9 | total | 2.147483647E9 |
|
||||
| test.c:461:14:461:14 | r | 2.147483647E9 |
|
||||
| test.c:464:10:464:14 | total | 2.147483647E9 |
|
||||
| test.cpp:10:7:10:7 | b | 2.147483647E9 |
|
||||
| test.cpp:11:5:11:5 | x | 2.147483647E9 |
|
||||
| test.cpp:13:10:13:10 | x | 2.147483647E9 |
|
||||
|
||||
@@ -365,7 +365,7 @@ int callCommand(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int shifts(void)
|
||||
void shifts(void)
|
||||
{
|
||||
unsigned int x = 3;
|
||||
|
||||
@@ -374,7 +374,7 @@ int shifts(void)
|
||||
if (x >> 1 == 1) {} // always true [NOT DETECTED]
|
||||
}
|
||||
|
||||
int bitwise_ands()
|
||||
void bitwise_ands()
|
||||
{
|
||||
unsigned int x = 0xFF;
|
||||
|
||||
@@ -382,3 +382,13 @@ int bitwise_ands()
|
||||
if ((x & 2) >= 2) {}
|
||||
if ((x & 2) >= 3) {} // always false
|
||||
}
|
||||
|
||||
void unsigned_mult(unsigned int x, unsigned int y) {
|
||||
if(x < 13 && y < 35) {
|
||||
if(x * y > 1024) {} // always false [NOT DETECTED]
|
||||
if(x * y < 204) {}
|
||||
if(x >= 3 && y >= 2) {
|
||||
if(x * y < 5) {} // always false [NOT DETECTED]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user