File tree Expand file tree Collapse file tree 6 files changed +21
-16
lines changed
Likely Bugs/Memory Management
semmle/code/cpp/controlflow/internal
javascript/ql/src/META-INF Expand file tree Collapse file tree 6 files changed +21
-16
lines changed Original file line number Diff line number Diff line change @@ -54,13 +54,13 @@ Type stripType(Type t) {
5454
5555/**
5656 * Holds if `t` points to `base` via a specified number of levels of pointer
57- * indirection. Intermediate typedefs and array types are allowed.
57+ * indirection. Intermediate typedefs and array types are allowed. Note that
58+ * `base` is a stripped type (via `stripType`).
5859 */
5960predicate pointerIndirection ( Type t , int indirection , Type base ) {
60- exists ( Type u |
61- u = stripType ( t ) and
62- u = stripType ( base ) and
63- not u instanceof PointerType and
61+ (
62+ base = stripType ( t ) and
63+ not base instanceof PointerType and
6464 indirection = 0
6565 ) or (
6666 pointerIndirection ( stripType ( t ) .( PointerType ) .getBaseType ( ) , indirection - 1 , base )
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ Manifest-Version: 1.0
22Bundle-ManifestVersion : 2
33Bundle-Name : Semmle C/C++ Default Queries
44Bundle-SymbolicName : com.semmle.plugin.semmlecode.cpp.queries;singleton:=true
5- Bundle-Version : 1.18.2 .qualifier
5+ Bundle-Version : 1.18.3 .qualifier
66Bundle-Vendor : Semmle Ltd.
77Bundle-ActivationPolicy : lazy
8- Require-Bundle : com.semmle.plugin.qdt.ui;bundle-version="[1.18.2 .qualifier,1.18.2 .qualifier]"
8+ Require-Bundle : com.semmle.plugin.qdt.ui;bundle-version="[1.18.3 .qualifier,1.18.3 .qualifier]"
Original file line number Diff line number Diff line change @@ -442,12 +442,17 @@ library class ExprEvaluator extends int {
442442 )
443443 }
444444
445+ /** Holds if the function `f` is considered by the analysis and may return `ret`. */
446+ pragma [ noinline]
447+ private predicate interestingReturnValue ( Function f , Expr ret ) {
448+ interestingFunction ( _, f ) and
449+ returnStmt ( f , ret )
450+ }
451+
445452 private int getFunctionValue ( Function f ) {
446- interestingFunction ( _, f )
447- and
448453 // All returns must have the same int value
449454 // And it must have at least one return
450- forex ( Expr ret | returnStmt ( f , ret ) | result = getValueInternalNonSubExpr ( ret ) )
455+ forex ( Expr ret | interestingReturnValue ( f , ret ) | result = getValueInternalNonSubExpr ( ret ) )
451456 }
452457
453458 /**
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ Manifest-Version: 1.0
22Bundle-ManifestVersion : 2
33Bundle-Name : Semmle C# Default Queries
44Bundle-SymbolicName : com.semmle.plugin.semmlecode.csharp.queries;singleton:=true
5- Bundle-Version : 1.18.2 .qualifier
5+ Bundle-Version : 1.18.3 .qualifier
66Bundle-Vendor : Semmle Ltd.
77Bundle-ActivationPolicy : lazy
8- Require-Bundle : com.semmle.plugin.qdt.ui;bundle-version="[1.18.2 .qualifier,1.18.2 .qualifier]"
8+ Require-Bundle : com.semmle.plugin.qdt.ui;bundle-version="[1.18.3 .qualifier,1.18.3 .qualifier]"
Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ Manifest-Version: 1.0
22Bundle-ManifestVersion : 2
33Bundle-Name : Semmle Default Java Queries
44Bundle-SymbolicName : com.semmle.plugin.semmlecode.queries;singleton:=true
5- Bundle-Version : 1.18.2 .qualifier
5+ Bundle-Version : 1.18.3 .qualifier
66Bundle-Vendor : Semmle Ltd.
77Bundle-ActivationPolicy : lazy
8- Require-Bundle : com.semmle.plugin.qdt.ui;bundle-version="[1.18.2 .qualifier,1.18.2 .qualifier]"
8+ Require-Bundle : com.semmle.plugin.qdt.ui;bundle-version="[1.18.3 .qualifier,1.18.3 .qualifier]"
99
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ Manifest-Version: 1.0
22Bundle-ManifestVersion : 2
33Bundle-Name : Semmle JavaScript Default Queries
44Bundle-SymbolicName : com.semmle.plugin.semmlecode.javascript.queries;singleton:=true
5- Bundle-Version : 1.18.2 .qualifier
5+ Bundle-Version : 1.18.3 .qualifier
66Bundle-Vendor : Semmle Ltd.
77Bundle-ActivationPolicy : lazy
8- Require-Bundle : com.semmle.plugin.qdt.ui;bundle-version="[1.18.2 .qualifier,1.18.2 .qualifier]"
8+ Require-Bundle : com.semmle.plugin.qdt.ui;bundle-version="[1.18.3 .qualifier,1.18.3 .qualifier]"
You can’t perform that action at this time.
0 commit comments