File tree Expand file tree Collapse file tree 5 files changed +38
-39
lines changed
experimental/semmle/code/cpp/security Expand file tree Collapse file tree 5 files changed +38
-39
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ import semmle.code.cpp.dataflow.TaintTracking
7
7
import experimental.semmle.code.cpp.security.PrivateData
8
8
import semmle.code.cpp.security.FileWrite
9
9
import semmle.code.cpp.security.BufferWrite
10
- import semmle.code.cpp.dataflow.TaintTracking
11
10
12
11
module PrivateCleartextWrite {
13
12
/**
Original file line number Diff line number Diff line change @@ -441,40 +441,6 @@ class ConstructorCall extends FunctionCall {
441
441
override Constructor getTarget ( ) { result = super .getTarget ( ) }
442
442
}
443
443
444
- /**
445
- * A C++ `throw` expression.
446
- * ```
447
- * throw Exc(2);
448
- * ```
449
- */
450
- class ThrowExpr extends Expr , @throw_expr {
451
- /**
452
- * Gets the expression that will be thrown, if any. There is no result if
453
- * `this` is a `ReThrowExpr`.
454
- */
455
- Expr getExpr ( ) { result = this .getChild ( 0 ) }
456
-
457
- override string getAPrimaryQlClass ( ) { result = "ThrowExpr" }
458
-
459
- override string toString ( ) { result = "throw ..." }
460
-
461
- override int getPrecedence ( ) { result = 1 }
462
- }
463
-
464
- /**
465
- * A C++ `throw` expression with no argument (which causes the current exception to be re-thrown).
466
- * ```
467
- * throw;
468
- * ```
469
- */
470
- class ReThrowExpr extends ThrowExpr {
471
- ReThrowExpr ( ) { this .getType ( ) instanceof VoidType }
472
-
473
- override string getAPrimaryQlClass ( ) { result = "ReThrowExpr" }
474
-
475
- override string toString ( ) { result = "re-throw exception " }
476
- }
477
-
478
444
/**
479
445
* A call to a destructor.
480
446
* ```
Original file line number Diff line number Diff line change @@ -1146,6 +1146,40 @@ class BlockExpr extends Literal {
1146
1146
Function getFunction ( ) { code_block ( underlyingElement ( this ) , unresolveElement ( result ) ) }
1147
1147
}
1148
1148
1149
+ /**
1150
+ * A C++ `throw` expression.
1151
+ * ```
1152
+ * throw Exc(2);
1153
+ * ```
1154
+ */
1155
+ class ThrowExpr extends Expr , @throw_expr {
1156
+ /**
1157
+ * Gets the expression that will be thrown, if any. There is no result if
1158
+ * `this` is a `ReThrowExpr`.
1159
+ */
1160
+ Expr getExpr ( ) { result = this .getChild ( 0 ) }
1161
+
1162
+ override string getAPrimaryQlClass ( ) { result = "ThrowExpr" }
1163
+
1164
+ override string toString ( ) { result = "throw ..." }
1165
+
1166
+ override int getPrecedence ( ) { result = 1 }
1167
+ }
1168
+
1169
+ /**
1170
+ * A C++ `throw` expression with no argument (which causes the current exception to be re-thrown).
1171
+ * ```
1172
+ * throw;
1173
+ * ```
1174
+ */
1175
+ class ReThrowExpr extends ThrowExpr {
1176
+ ReThrowExpr ( ) { this .getType ( ) instanceof VoidType }
1177
+
1178
+ override string getAPrimaryQlClass ( ) { result = "ReThrowExpr" }
1179
+
1180
+ override string toString ( ) { result = "re-throw exception " }
1181
+ }
1182
+
1149
1183
/**
1150
1184
* A C++11 `noexcept` expression, returning `true` if its subexpression is guaranteed
1151
1185
* not to `throw` exceptions. For example:
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ abstract class IteratorReferenceFunction extends Function { }
22
22
abstract class GetIteratorFunction extends Function {
23
23
/**
24
24
* Holds if the return value or buffer represented by `output` is an iterator over the container
25
- * passd in the argument, qualifier, or buffer represented by `input`.
25
+ * passed in the argument, qualifier, or buffer represented by `input`.
26
26
*/
27
27
abstract predicate getsIterator ( FunctionInput input , FunctionOutput output ) ;
28
28
}
Original file line number Diff line number Diff line change @@ -678,7 +678,7 @@ class CoReturnStmt extends Stmt, @stmt_co_return {
678
678
override string getAPrimaryQlClass ( ) { result = "CoReturnStmt" }
679
679
680
680
/**
681
- * Gets the operand of this ' co_return' statement.
681
+ * Gets the operand of this ` co_return` statement.
682
682
*
683
683
* For example, for
684
684
* ```
@@ -693,7 +693,7 @@ class CoReturnStmt extends Stmt, @stmt_co_return {
693
693
FunctionCall getOperand ( ) { result = this .getChild ( 0 ) }
694
694
695
695
/**
696
- * Gets the expression of this ' co_return' statement, if any.
696
+ * Gets the expression of this ` co_return` statement, if any.
697
697
*
698
698
* For example, for
699
699
* ```
@@ -707,7 +707,7 @@ class CoReturnStmt extends Stmt, @stmt_co_return {
707
707
Expr getExpr ( ) { result = this .getOperand ( ) .getArgument ( 0 ) }
708
708
709
709
/**
710
- * Holds if this ' co_return' statement has an expression.
710
+ * Holds if this ` co_return` statement has an expression.
711
711
*
712
712
* For example, this holds for
713
713
* ```
You can’t perform that action at this time.
0 commit comments