mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
delete all deprecations that are over 14 months old
This commit is contained in:
@@ -111,24 +111,6 @@ class Class extends UserType {
|
||||
result = this.getCanonicalMember(index).(TemplateVariable).getAnInstantiation()
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `getCanonicalMember(int)` or `getAMember(int)` instead.
|
||||
* Gets the `index`th member of this class.
|
||||
*/
|
||||
deprecated Declaration getMember(int index) {
|
||||
member(underlyingElement(this), index, unresolveElement(result))
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: As this includes a somewhat arbitrary number of
|
||||
* template instantiations, it is unlikely to do what
|
||||
* you need.
|
||||
* Gets the number of members that this class has. This includes both
|
||||
* templates that are in this class, and instantiations of those
|
||||
* templates.
|
||||
*/
|
||||
deprecated int getNumMember() { result = count(this.getAMember()) }
|
||||
|
||||
/**
|
||||
* Gets a private member declared in this class, struct or union.
|
||||
* For template members, this may be either the template or an
|
||||
@@ -208,23 +190,6 @@ class Class extends UserType {
|
||||
*/
|
||||
deprecated predicate hasCopyConstructor() { this.getAMemberFunction() instanceof CopyConstructor }
|
||||
|
||||
/**
|
||||
* Holds if this class has a copy assignment operator that is either
|
||||
* explicitly declared (though possibly `= delete`) or is auto-generated,
|
||||
* non-trivial and called from somewhere.
|
||||
*
|
||||
* DEPRECATED: There is more than one reasonable definition of what it means
|
||||
* to have a copy assignment operator, and we do not want to promote one
|
||||
* particular definition by naming it with this predicate. Having a copy
|
||||
* assignment operator could mean that such a member is declared or defined
|
||||
* in the source or that it is callable by a particular caller. For C++11,
|
||||
* there's also a question of whether to include members that are defaulted
|
||||
* or deleted.
|
||||
*/
|
||||
deprecated predicate hasCopyAssignmentOperator() {
|
||||
this.getAMemberFunction() instanceof CopyAssignmentOperator
|
||||
}
|
||||
|
||||
/**
|
||||
* Like accessOfBaseMember but returns multiple results if there are multiple
|
||||
* paths to `base` through the inheritance graph.
|
||||
@@ -1070,31 +1035,6 @@ class PartialClassTemplateSpecialization extends ClassTemplateSpecialization {
|
||||
override string getAPrimaryQlClass() { result = "PartialClassTemplateSpecialization" }
|
||||
}
|
||||
|
||||
/**
|
||||
* An "interface" is a class that only contains pure virtual functions (and contains
|
||||
* at least one such function). For example:
|
||||
* ```
|
||||
* class MyInterfaceClass {
|
||||
* public:
|
||||
* virtual void myMethod1() = 0;
|
||||
* virtual void myMethod2() = 0;
|
||||
* };
|
||||
* ```
|
||||
*
|
||||
* DEPRECATED: This class is considered to be too specific for general usage.
|
||||
*/
|
||||
deprecated class Interface extends Class {
|
||||
Interface() {
|
||||
forex(Declaration m |
|
||||
m.getDeclaringType() = this.getABaseClass*() and not compgenerated(unresolveElement(m))
|
||||
|
|
||||
m instanceof PureVirtualFunction
|
||||
)
|
||||
}
|
||||
|
||||
override string getAPrimaryQlClass() { result = "Interface" }
|
||||
}
|
||||
|
||||
/**
|
||||
* A class/struct derivation that is virtual. For example the derivation in
|
||||
* the following code is a `VirtualClassDerivation`:
|
||||
|
||||
@@ -55,9 +55,6 @@ class ElementBase extends @element {
|
||||
cached
|
||||
string toString() { none() }
|
||||
|
||||
/** DEPRECATED: use `getAPrimaryQlClass` instead. */
|
||||
deprecated string getCanonicalQLClass() { result = this.getAPrimaryQlClass() }
|
||||
|
||||
/**
|
||||
* Gets a comma-separated list of the names of the primary CodeQL classes to which this element belongs.
|
||||
*/
|
||||
@@ -91,13 +88,6 @@ class Element extends ElementBase {
|
||||
*/
|
||||
predicate fromSource() { this.getFile().fromSource() }
|
||||
|
||||
/**
|
||||
* Holds if this element may be from a library.
|
||||
*
|
||||
* DEPRECATED: always true.
|
||||
*/
|
||||
deprecated predicate fromLibrary() { this.getFile().fromLibrary() }
|
||||
|
||||
/** Gets the primary location of this element. */
|
||||
Location getLocation() { none() }
|
||||
|
||||
|
||||
@@ -34,14 +34,7 @@ class Container extends Locatable, @container {
|
||||
*/
|
||||
string getAbsolutePath() { none() } // overridden by subclasses
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `getLocation` instead.
|
||||
* Gets a URL representing the location of this container.
|
||||
*
|
||||
* For more information see [Providing URLs](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/#providing-urls).
|
||||
*/
|
||||
deprecated string getURL() { none() } // overridden by subclasses
|
||||
|
||||
// overridden by subclasses
|
||||
/**
|
||||
* Gets the relative path of this file or folder from the root folder of the
|
||||
* analyzed source location. The relative path of the root folder itself is
|
||||
@@ -184,43 +177,17 @@ class Folder extends Container, @folder {
|
||||
|
||||
override string getAPrimaryQlClass() { result = "Folder" }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `getLocation` instead.
|
||||
* Gets the URL of this folder.
|
||||
*/
|
||||
deprecated override string getURL() { result = "file://" + this.getAbsolutePath() + ":0:0:0:0" }
|
||||
|
||||
/**
|
||||
* DEPRECATED: use `getAbsolutePath` instead.
|
||||
* Gets the name of this folder.
|
||||
*/
|
||||
deprecated string getName() { folders(underlyingElement(this), result) }
|
||||
|
||||
/**
|
||||
* DEPRECATED: use `getAbsolutePath` instead.
|
||||
* Holds if this element is named `name`.
|
||||
*/
|
||||
deprecated predicate hasName(string name) { name = this.getName() }
|
||||
|
||||
/**
|
||||
* DEPRECATED: use `getAbsolutePath` instead.
|
||||
* Gets the full name of this folder.
|
||||
*/
|
||||
deprecated string getFullName() { result = this.getName() }
|
||||
|
||||
/**
|
||||
* DEPRECATED: use `getBaseName` instead.
|
||||
* Gets the last part of the folder name.
|
||||
*/
|
||||
deprecated string getShortName() { result = this.getBaseName() }
|
||||
|
||||
/**
|
||||
* DEPRECATED: use `getParentContainer` instead.
|
||||
* Gets the parent folder.
|
||||
*/
|
||||
deprecated Folder getParent() {
|
||||
containerparent(unresolveElement(result), underlyingElement(this))
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -247,12 +214,6 @@ class File extends Container, @file {
|
||||
result.hasLocationInfo(_, 0, 0, 0, 0)
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `getLocation` instead.
|
||||
* Gets the URL of this file.
|
||||
*/
|
||||
deprecated override string getURL() { result = "file://" + this.getAbsolutePath() + ":0:0:0:0" }
|
||||
|
||||
/** Holds if this file was compiled as C (at any point). */
|
||||
predicate compiledAsC() { fileannotations(underlyingElement(this), 1, "compiled as c", "1") }
|
||||
|
||||
@@ -308,13 +269,6 @@ class File extends Container, @file {
|
||||
*/
|
||||
override predicate fromSource() { numlines(underlyingElement(this), _, _, _) }
|
||||
|
||||
/**
|
||||
* Holds if this file may be from a library.
|
||||
*
|
||||
* DEPRECATED: For historical reasons this is true for any file.
|
||||
*/
|
||||
deprecated override predicate fromLibrary() { any() }
|
||||
|
||||
/** Gets the metric file. */
|
||||
MetricFile getMetrics() { result = this }
|
||||
|
||||
@@ -428,25 +382,3 @@ class CppFile extends File {
|
||||
|
||||
override string getAPrimaryQlClass() { result = "CppFile" }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Objective-C is no longer supported.
|
||||
* An Objective C source file, as determined by file extension.
|
||||
*
|
||||
* For the related notion of whether a file is compiled as Objective C
|
||||
* code, use `File.compiledAsObjC`.
|
||||
*/
|
||||
deprecated class ObjCFile extends File {
|
||||
ObjCFile() { none() }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Objective-C is no longer supported.
|
||||
* An Objective C++ source file, as determined by file extension.
|
||||
*
|
||||
* For the related notion of whether a file is compiled as Objective C++
|
||||
* code, use `File.compiledAsObjCpp`.
|
||||
*/
|
||||
deprecated class ObjCppFile extends File {
|
||||
ObjCppFile() { none() }
|
||||
}
|
||||
|
||||
@@ -105,25 +105,6 @@ class Location extends @location {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `Location` instead.
|
||||
* A location of an element. Not used for expressions or statements, which
|
||||
* instead use LocationExpr and LocationStmt respectively.
|
||||
*/
|
||||
deprecated library class LocationDefault extends Location, @location_default { }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `Location` instead.
|
||||
* A location of a statement.
|
||||
*/
|
||||
deprecated library class LocationStmt extends Location, @location_stmt { }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `Location` instead.
|
||||
* A location of an expression.
|
||||
*/
|
||||
deprecated library class LocationExpr extends Location, @location_expr { }
|
||||
|
||||
/**
|
||||
* Gets the length of the longest line in file `f`.
|
||||
*/
|
||||
|
||||
@@ -30,16 +30,6 @@ class Macro extends PreprocessorDirective, @ppd_define {
|
||||
else result = "#define " + this.getHead() + " " + this.getBody()
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if the body of the macro starts with an unmatched closing
|
||||
* parenthesis. For example:
|
||||
*
|
||||
* #define RPAREN() )
|
||||
*
|
||||
* DEPRECATED: This predicate has a misleading name.
|
||||
*/
|
||||
deprecated predicate isFunctionLike() { this.getBody().regexpMatch("[^(]*\\).*") }
|
||||
|
||||
/**
|
||||
* Gets the name of the macro. For example, `MAX` in
|
||||
* `#define MAX(x,y) (((x)>(y))?(x):(y))`.
|
||||
@@ -261,46 +251,6 @@ class MacroInvocation extends MacroAccess {
|
||||
string getExpandedArgument(int i) { macro_argument_expanded(underlyingElement(this), i, result) }
|
||||
}
|
||||
|
||||
/**
|
||||
* A top-level expression generated by a macro invocation.
|
||||
*
|
||||
* DEPRECATED: Use `MacroInvocation.getExpr()` directly to get an
|
||||
* expression generated at the top-level of a macro invocation. Use
|
||||
* `MacroInvocation.getAnAffectedElement()` to get any element generated
|
||||
* by a macro invocation.
|
||||
*/
|
||||
deprecated class MacroInvocationExpr extends Expr {
|
||||
MacroInvocationExpr() { exists(MacroInvocation i | this = i.getExpr()) }
|
||||
|
||||
/**
|
||||
* Gets the macro invocation of which this is the top-level expression.
|
||||
*/
|
||||
MacroInvocation getInvocation() { result.getExpr() = this }
|
||||
|
||||
/** Gets the name of the invoked macro. */
|
||||
string getMacroName() { result = this.getInvocation().getMacroName() }
|
||||
}
|
||||
|
||||
/**
|
||||
* A top-level statement generated by a macro invocation.
|
||||
*
|
||||
* DEPRECATED: Use `MacroInvocation.getStmt()` directly to get a
|
||||
* statement generated at the top-level of a macro invocation. Use
|
||||
* `MacroInvocation.getAnAffectedElement()` to get any element generated
|
||||
* by a macro invocation.
|
||||
*/
|
||||
deprecated class MacroInvocationStmt extends Stmt {
|
||||
MacroInvocationStmt() { exists(MacroInvocation i | this = i.getStmt()) }
|
||||
|
||||
/**
|
||||
* Gets the macro invocation of which this is the top-level statement.
|
||||
*/
|
||||
MacroInvocation getInvocation() { result.getStmt() = this }
|
||||
|
||||
/** Gets the name of the invoked macro. */
|
||||
string getMacroName() { result = this.getInvocation().getMacroName() }
|
||||
}
|
||||
|
||||
/** Holds if `l` is the location of a macro. */
|
||||
predicate macroLocation(Location l) { macrolocationbind(_, l) }
|
||||
|
||||
|
||||
@@ -233,40 +233,6 @@ class ImplicitConversionFunction extends MemberFunction {
|
||||
Type getDestType() { none() } // overridden in subclasses
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: as of C++11 this class does not correspond perfectly with the
|
||||
* language definition of a converting constructor.
|
||||
*
|
||||
* A C++ constructor that also defines an implicit conversion. For example the
|
||||
* function `MyClass` in the following code is a `ConversionConstructor`:
|
||||
* ```
|
||||
* class MyClass {
|
||||
* public:
|
||||
* MyClass(const MyOtherClass &from) {
|
||||
* ...
|
||||
* }
|
||||
* };
|
||||
* ```
|
||||
*/
|
||||
deprecated class ConversionConstructor extends Constructor, ImplicitConversionFunction {
|
||||
ConversionConstructor() {
|
||||
strictcount(Parameter p | p = this.getAParameter() and not p.hasInitializer()) = 1 and
|
||||
not this.hasSpecifier("explicit")
|
||||
}
|
||||
|
||||
override string getAPrimaryQlClass() {
|
||||
not this instanceof CopyConstructor and
|
||||
not this instanceof MoveConstructor and
|
||||
result = "ConversionConstructor"
|
||||
}
|
||||
|
||||
/** Gets the type this `ConversionConstructor` takes as input. */
|
||||
override Type getSourceType() { result = this.getParameter(0).getType() }
|
||||
|
||||
/** Gets the type this `ConversionConstructor` is a constructor of. */
|
||||
override Type getDestType() { result = this.getDeclaringType() }
|
||||
}
|
||||
|
||||
private predicate hasCopySignature(MemberFunction f) {
|
||||
f.getParameter(0).getUnspecifiedType().(LValueReferenceType).getBaseType() = f.getDeclaringType()
|
||||
}
|
||||
|
||||
@@ -86,13 +86,6 @@ class Namespace extends NameQualifyingElement, @namespace {
|
||||
/** Holds if this namespace may be from source. */
|
||||
override predicate fromSource() { this.getADeclaration().fromSource() }
|
||||
|
||||
/**
|
||||
* Holds if this namespace is in a library.
|
||||
*
|
||||
* DEPRECATED: never holds.
|
||||
*/
|
||||
deprecated override predicate fromLibrary() { not this.fromSource() }
|
||||
|
||||
/** Gets the metric namespace. */
|
||||
MetricNamespace getMetrics() { result = this }
|
||||
|
||||
@@ -233,11 +226,6 @@ class GlobalNamespace extends Namespace {
|
||||
|
||||
override Namespace getParentNamespace() { none() }
|
||||
|
||||
/**
|
||||
* DEPRECATED: use `getName()`.
|
||||
*/
|
||||
deprecated string getFullName() { result = this.getName() }
|
||||
|
||||
override string getFriendlyName() { result = "(global namespace)" }
|
||||
}
|
||||
|
||||
|
||||
@@ -4,193 +4,3 @@
|
||||
|
||||
import semmle.code.cpp.Class
|
||||
private import semmle.code.cpp.internal.ResolveClass
|
||||
|
||||
/**
|
||||
* DEPRECATED: Objective-C is no longer supported.
|
||||
* An Objective C class.
|
||||
*/
|
||||
deprecated class ObjectiveClass extends Class {
|
||||
ObjectiveClass() { none() }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Objective-C is no longer supported.
|
||||
* An Objective C protocol.
|
||||
*/
|
||||
deprecated class Protocol extends Class {
|
||||
Protocol() { none() }
|
||||
|
||||
/**
|
||||
* Holds if the type implements the protocol, either because the type
|
||||
* itself does, or because it is a type conforming to the protocol.
|
||||
*/
|
||||
predicate isImplementedBy(Type t) { none() }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Objective-C is no longer supported.
|
||||
* A type which conforms to a protocol. Use `getAProtocol` to get a
|
||||
* protocol that this type conforms to.
|
||||
*/
|
||||
deprecated class TypeConformingToProtocol extends DerivedType {
|
||||
TypeConformingToProtocol() { none() }
|
||||
|
||||
/** Gets a protocol that this type conforms to. */
|
||||
Protocol getAProtocol() { none() }
|
||||
|
||||
/** Gets the size of this type. */
|
||||
override int getSize() { none() }
|
||||
|
||||
override int getAlignment() { none() }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Objective-C is no longer supported.
|
||||
* An Objective C `@autoreleasepool` statement, for example
|
||||
* `@autoreleasepool { int x; int y; }`.
|
||||
*/
|
||||
deprecated class AutoReleasePoolStmt extends Stmt {
|
||||
AutoReleasePoolStmt() { none() }
|
||||
|
||||
override string toString() { none() }
|
||||
|
||||
/** Gets the body statement of this `@autoreleasepool` statement. */
|
||||
Stmt getStmt() { none() }
|
||||
|
||||
override predicate mayBeImpure() { none() }
|
||||
|
||||
override predicate mayBeGloballyImpure() { none() }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Objective-C is no longer supported.
|
||||
* An Objective C `@synchronized statement`, for example
|
||||
* `@synchronized (x) { [x complicationOperation]; }`.
|
||||
*/
|
||||
deprecated class SynchronizedStmt extends Stmt {
|
||||
SynchronizedStmt() { none() }
|
||||
|
||||
override string toString() { none() }
|
||||
|
||||
/** Gets the expression which gives the object to be locked. */
|
||||
Expr getLockedObject() { none() }
|
||||
|
||||
/** Gets the body statement of this `@synchronized` statement. */
|
||||
Stmt getStmt() { none() }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Objective-C is no longer supported.
|
||||
* An Objective C for-in statement.
|
||||
*/
|
||||
deprecated class ForInStmt extends Loop {
|
||||
ForInStmt() { none() }
|
||||
|
||||
/**
|
||||
* Gets the condition expression of the `while` statement that the
|
||||
* `for...in` statement desugars into.
|
||||
*/
|
||||
override Expr getCondition() { none() }
|
||||
|
||||
override Expr getControllingExpr() { none() }
|
||||
|
||||
/** Gets the collection that the loop iterates over. */
|
||||
Expr getCollection() { none() }
|
||||
|
||||
/** Gets the body of the loop. */
|
||||
override Stmt getStmt() { none() }
|
||||
|
||||
override string toString() { none() }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Objective-C is no longer supported.
|
||||
* An Objective C category or class extension.
|
||||
*/
|
||||
deprecated class Category extends Class {
|
||||
Category() { none() }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Objective-C is no longer supported.
|
||||
* An Objective C class extension.
|
||||
*/
|
||||
deprecated class ClassExtension extends Category {
|
||||
ClassExtension() { none() }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Objective-C is no longer supported.
|
||||
* An Objective C try statement.
|
||||
*/
|
||||
deprecated class ObjcTryStmt extends TryStmt {
|
||||
ObjcTryStmt() { none() }
|
||||
|
||||
override string toString() { none() }
|
||||
|
||||
/** Gets the finally clause of this try statement, if any. */
|
||||
FinallyBlock getFinallyClause() { none() }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Objective-C is no longer supported.
|
||||
* An Objective C `@finally` block.
|
||||
*/
|
||||
deprecated class FinallyBlock extends BlockStmt {
|
||||
FinallyBlock() { none() }
|
||||
|
||||
/** Gets the try statement corresponding to this finally block. */
|
||||
ObjcTryStmt getTryStmt() { none() }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Objective-C is no longer supported.
|
||||
* An Objective C `@property`.
|
||||
*/
|
||||
deprecated class Property extends Declaration {
|
||||
Property() { none() }
|
||||
|
||||
/** Gets the name of this property. */
|
||||
override string getName() { none() }
|
||||
|
||||
/**
|
||||
* Gets nothing (provided for compatibility with Declaration).
|
||||
*
|
||||
* For the attribute list following the `@property` keyword, use
|
||||
* `getAnAttribute()`.
|
||||
*/
|
||||
override Specifier getASpecifier() { none() }
|
||||
|
||||
/**
|
||||
* Gets an attribute of this property (such as `readonly`, `nonatomic`,
|
||||
* or `getter=isEnabled`).
|
||||
*/
|
||||
Attribute getAnAttribute() { none() }
|
||||
|
||||
override Location getADeclarationLocation() { result = getLocation() }
|
||||
|
||||
override Location getDefinitionLocation() { result = getLocation() }
|
||||
|
||||
override Location getLocation() { none() }
|
||||
|
||||
/** Gets the type of this property. */
|
||||
Type getType() { none() }
|
||||
|
||||
/**
|
||||
* Gets the instance method which is called to get the value of this
|
||||
* property.
|
||||
*/
|
||||
MemberFunction getGetter() { none() }
|
||||
|
||||
/**
|
||||
* Gets the instance method which is called to set the value of this
|
||||
* property (if it is a writable property).
|
||||
*/
|
||||
MemberFunction getSetter() { none() }
|
||||
|
||||
/**
|
||||
* Gets the instance variable which stores the property value (if this
|
||||
* property was explicitly or automatically `@synthesize`d).
|
||||
*/
|
||||
MemberVariable getInstanceVariable() { none() }
|
||||
}
|
||||
|
||||
@@ -95,22 +95,6 @@ class Parameter extends LocalScopeVariable, @parameter {
|
||||
else result = this.getADeclarationEntry()
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the name of this parameter in the given block (which should be
|
||||
* the body of a function with which the parameter is associated).
|
||||
*
|
||||
* DEPRECATED: this method was used in a previous implementation of
|
||||
* getName, but is no longer in use.
|
||||
*/
|
||||
deprecated string getNameInBlock(BlockStmt b) {
|
||||
exists(ParameterDeclarationEntry pde |
|
||||
pde.getFunctionDeclarationEntry().getBlock() = b and
|
||||
this.getFunction().getBlock() = b and
|
||||
pde.getVariable() = this and
|
||||
result = pde.getName()
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if this parameter has a name.
|
||||
*
|
||||
|
||||
@@ -1085,50 +1085,6 @@ class DerivedType extends Type, @derivedtype {
|
||||
override predicate involvesTemplateParameter() { this.getBaseType().involvesTemplateParameter() }
|
||||
|
||||
override Type stripType() { result = this.getBaseType().stripType() }
|
||||
|
||||
/**
|
||||
* Holds if this type has the `__autoreleasing` specifier or if it points to
|
||||
* a type with the `__autoreleasing` specifier.
|
||||
*
|
||||
* DEPRECATED: use `hasSpecifier` directly instead.
|
||||
*/
|
||||
deprecated predicate isAutoReleasing() {
|
||||
this.hasSpecifier("__autoreleasing") or
|
||||
this.(PointerType).getBaseType().hasSpecifier("__autoreleasing")
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if this type has the `__strong` specifier or if it points to
|
||||
* a type with the `__strong` specifier.
|
||||
*
|
||||
* DEPRECATED: use `hasSpecifier` directly instead.
|
||||
*/
|
||||
deprecated predicate isStrong() {
|
||||
this.hasSpecifier("__strong") or
|
||||
this.(PointerType).getBaseType().hasSpecifier("__strong")
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if this type has the `__unsafe_unretained` specifier or if it points
|
||||
* to a type with the `__unsafe_unretained` specifier.
|
||||
*
|
||||
* DEPRECATED: use `hasSpecifier` directly instead.
|
||||
*/
|
||||
deprecated predicate isUnsafeRetained() {
|
||||
this.hasSpecifier("__unsafe_unretained") or
|
||||
this.(PointerType).getBaseType().hasSpecifier("__unsafe_unretained")
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if this type has the `__weak` specifier or if it points to
|
||||
* a type with the `__weak` specifier.
|
||||
*
|
||||
* DEPRECATED: use `hasSpecifier` directly instead.
|
||||
*/
|
||||
deprecated predicate isWeak() {
|
||||
this.hasSpecifier("__weak") or
|
||||
this.(PointerType).getBaseType().hasSpecifier("__weak")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -106,25 +106,4 @@ class NestedTypedefType extends TypedefType {
|
||||
NestedTypedefType() { this.isMember() }
|
||||
|
||||
override string getAPrimaryQlClass() { result = "NestedTypedefType" }
|
||||
|
||||
/**
|
||||
* DEPRECATED: use `.hasSpecifier("private")` instead.
|
||||
*
|
||||
* Holds if this member is private.
|
||||
*/
|
||||
deprecated predicate isPrivate() { this.hasSpecifier("private") }
|
||||
|
||||
/**
|
||||
* DEPRECATED: `.hasSpecifier("protected")` instead.
|
||||
*
|
||||
* Holds if this member is protected.
|
||||
*/
|
||||
deprecated predicate isProtected() { this.hasSpecifier("protected") }
|
||||
|
||||
/**
|
||||
* DEPRECATED: use `.hasSpecifier("public")` instead.
|
||||
*
|
||||
* Holds if this member is public.
|
||||
*/
|
||||
deprecated predicate isPublic() { this.hasSpecifier("public") }
|
||||
}
|
||||
|
||||
@@ -556,24 +556,6 @@ class MemberVariable extends Variable, @membervariable {
|
||||
private Type getAType() { membervariables(underlyingElement(this), unresolveElement(result), _) }
|
||||
}
|
||||
|
||||
/**
|
||||
* A C/C++ function pointer variable.
|
||||
*
|
||||
* DEPRECATED: use `Variable.getType() instanceof FunctionPointerType` instead.
|
||||
*/
|
||||
deprecated class FunctionPointerVariable extends Variable {
|
||||
FunctionPointerVariable() { this.getType() instanceof FunctionPointerType }
|
||||
}
|
||||
|
||||
/**
|
||||
* A C/C++ function pointer member variable.
|
||||
*
|
||||
* DEPRECATED: use `MemberVariable.getType() instanceof FunctionPointerType` instead.
|
||||
*/
|
||||
deprecated class FunctionPointerMemberVariable extends MemberVariable {
|
||||
FunctionPointerMemberVariable() { this instanceof FunctionPointerVariable }
|
||||
}
|
||||
|
||||
/**
|
||||
* A C++14 variable template. For example, in the following code the variable
|
||||
* template `v` defines a family of variables:
|
||||
|
||||
@@ -12,13 +12,6 @@ class XMLLocatable extends @xmllocatable, TXMLLocatable {
|
||||
/** Gets the source location for this element. */
|
||||
Location getLocation() { xmllocations(this, result) }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `getLocation()` instead.
|
||||
*
|
||||
* Gets the source location for this element.
|
||||
*/
|
||||
deprecated Location getALocation() { result = this.getLocation() }
|
||||
|
||||
/**
|
||||
* Holds if this element is at the specified location.
|
||||
* The location spans column `startcolumn` of line `startline` to
|
||||
@@ -83,21 +76,6 @@ class XMLParent extends @xmlparent {
|
||||
/** Gets the number of places in the body of this XML parent where text occurs. */
|
||||
int getNumberOfCharacterSets() { result = count(int pos | xmlChars(_, _, this, pos, _, _)) }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Internal.
|
||||
*
|
||||
* Append the character sequences of this XML parent from left to right, separated by a space,
|
||||
* up to a specified (zero-based) index.
|
||||
*/
|
||||
deprecated string charsSetUpTo(int n) {
|
||||
n = 0 and xmlChars(_, result, this, 0, _, _)
|
||||
or
|
||||
n > 0 and
|
||||
exists(string chars | xmlChars(_, chars, this, n, _, _) |
|
||||
result = this.charsSetUpTo(n - 1) + " " + chars
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the result of appending all the character sequences of this XML parent from
|
||||
* left to right, separated by a space.
|
||||
|
||||
@@ -2,20 +2,6 @@ import cpp
|
||||
import semmle.code.cpp.models.interfaces.Allocation
|
||||
import semmle.code.cpp.models.interfaces.Deallocation
|
||||
|
||||
/**
|
||||
* A library routine that allocates memory.
|
||||
*
|
||||
* DEPRECATED: Use the `AllocationFunction` class instead of this predicate.
|
||||
*/
|
||||
deprecated predicate allocationFunction(Function f) { f instanceof AllocationFunction }
|
||||
|
||||
/**
|
||||
* A call to a library routine that allocates memory.
|
||||
*
|
||||
* DEPRECATED: Use `AllocationExpr` instead (this also includes `new` expressions).
|
||||
*/
|
||||
deprecated predicate allocationCall(FunctionCall fc) { fc instanceof AllocationExpr }
|
||||
|
||||
/**
|
||||
* A library routine that frees memory.
|
||||
*/
|
||||
@@ -33,13 +19,6 @@ predicate freeCall(FunctionCall fc, Expr arg) { arg = fc.(DeallocationExpr).getF
|
||||
*/
|
||||
predicate isMemoryManagementExpr(Expr e) { isAllocationExpr(e) or e instanceof DeallocationExpr }
|
||||
|
||||
/**
|
||||
* Is e an allocation from stdlib.h (`malloc`, `realloc` etc)?
|
||||
*
|
||||
* DEPRECATED: Use `AllocationExpr` instead (this also includes `new` expressions).
|
||||
*/
|
||||
deprecated predicate isStdLibAllocationExpr(Expr e) { allocationCall(e) }
|
||||
|
||||
/**
|
||||
* Is e some kind of allocation (`new`, `alloc`, `realloc` etc)?
|
||||
*/
|
||||
@@ -48,19 +27,3 @@ predicate isAllocationExpr(Expr e) {
|
||||
or
|
||||
e = any(NewOrNewArrayExpr new | not exists(new.getPlacementPointer()))
|
||||
}
|
||||
|
||||
/**
|
||||
* Is e some kind of allocation (`new`, `alloc`, `realloc` etc) with a fixed size?
|
||||
*
|
||||
* DEPRECATED: Use `AllocationExpr.getSizeBytes()` instead.
|
||||
*/
|
||||
deprecated predicate isFixedSizeAllocationExpr(Expr allocExpr, int size) {
|
||||
size = allocExpr.(AllocationExpr).getSizeBytes()
|
||||
}
|
||||
|
||||
/**
|
||||
* Is e some kind of deallocation (`delete`, `free`, `realloc` etc)?
|
||||
*
|
||||
* DEPRECATED: Use `DeallocationExpr` instead.
|
||||
*/
|
||||
deprecated predicate isDeallocationExpr(Expr e) { e instanceof DeallocationExpr }
|
||||
|
||||
@@ -207,26 +207,6 @@ predicate variadicFormatter(Function f, string type, int formatParamIndex, int o
|
||||
callsVariadicFormatter(f, type, formatParamIndex, outputParamIndex)
|
||||
}
|
||||
|
||||
/**
|
||||
* A standard function such as `vprintf` that has a format parameter
|
||||
* and a variable argument list of type `va_arg`.
|
||||
*
|
||||
* DEPRECATED: Use the four argument version instead.
|
||||
*/
|
||||
deprecated predicate primitiveVariadicFormatter(TopLevelFunction f, int formatParamIndex) {
|
||||
primitiveVariadicFormatter(f, _, formatParamIndex, _)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `f` is a function such as `vprintf` that has a format parameter
|
||||
* (at `formatParamIndex`) and a variable argument list of type `va_arg`.
|
||||
*
|
||||
* DEPRECATED: Use the four argument version instead.
|
||||
*/
|
||||
deprecated predicate variadicFormatter(Function f, int formatParamIndex) {
|
||||
variadicFormatter(f, _, formatParamIndex, _)
|
||||
}
|
||||
|
||||
/**
|
||||
* A function not in the standard library which takes a `printf`-like formatting
|
||||
* string and a variable number of arguments.
|
||||
|
||||
@@ -223,20 +223,6 @@ class BasicBlock extends ControlFlowNodeBase {
|
||||
*/
|
||||
predicate inLoop() { this.getASuccessor+() = this }
|
||||
|
||||
/**
|
||||
* DEPRECATED since version 1.11: this predicate does not match the standard
|
||||
* definition of _loop header_.
|
||||
*
|
||||
* Holds if this basic block is in a loop of the control-flow graph and
|
||||
* additionally has an incoming edge that is not part of any loop containing
|
||||
* this basic block. A typical example would be the basic block that computes
|
||||
* `x > 0` in an outermost loop `while (x > 0) { ... }`.
|
||||
*/
|
||||
deprecated predicate isLoopHeader() {
|
||||
this.inLoop() and
|
||||
exists(BasicBlock pred | pred = this.getAPredecessor() and not pred = this.getASuccessor+())
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if control flow may reach this basic block from a function entry
|
||||
* point or any handler of a reachable `try` statement.
|
||||
|
||||
@@ -94,24 +94,6 @@ import ControlFlowGraphPublic
|
||||
*/
|
||||
class ControlFlowNodeBase extends ElementBase, @cfgnode { }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `ControlFlowNode.getATrueSuccessor()` instead.
|
||||
* Holds when `n2` is a control-flow node such that the control-flow
|
||||
* edge `(n1, n2)` may be taken when `n1` is an expression that is true.
|
||||
*/
|
||||
deprecated predicate truecond_base(ControlFlowNodeBase n1, ControlFlowNodeBase n2) {
|
||||
qlCFGTrueSuccessor(n1, n2)
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `ControlFlowNode.getAFalseSuccessor()` instead.
|
||||
* Holds when `n2` is a control-flow node such that the control-flow
|
||||
* edge `(n1, n2)` may be taken when `n1` is an expression that is false.
|
||||
*/
|
||||
deprecated predicate falsecond_base(ControlFlowNodeBase n1, ControlFlowNodeBase n2) {
|
||||
qlCFGFalseSuccessor(n1, n2)
|
||||
}
|
||||
|
||||
/**
|
||||
* An abstract class that can be extended to add additional edges to the
|
||||
* control-flow graph. Instances of this class correspond to the source nodes
|
||||
|
||||
@@ -4,125 +4,6 @@
|
||||
|
||||
import cpp
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `StackVariableReachability` instead.
|
||||
*
|
||||
* A reachability analysis for control-flow nodes involving stack variables.
|
||||
* This defines sources, sinks, and any other configurable aspect of the
|
||||
* analysis. Multiple analyses can coexist. To create an analysis, extend this
|
||||
* class with a subclass whose characteristic predicate is a unique singleton
|
||||
* string. For example, write
|
||||
*
|
||||
* ```
|
||||
* class MyAnalysisConfiguration extends LocalScopeVariableReachability {
|
||||
* MyAnalysisConfiguration() { this = "MyAnalysisConfiguration" }
|
||||
* // Override `isSource` and `isSink`.
|
||||
* // Override `isBarrier`.
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* Then, to query whether there is flow between some source and sink, call the
|
||||
* `reaches` predicate on an instance of `MyAnalysisConfiguration`.
|
||||
*/
|
||||
abstract deprecated class LocalScopeVariableReachability extends string {
|
||||
bindingset[this]
|
||||
LocalScopeVariableReachability() { length() >= 0 }
|
||||
|
||||
/** Holds if `node` is a source for the reachability analysis using variable `v`. */
|
||||
abstract predicate isSource(ControlFlowNode node, LocalScopeVariable v);
|
||||
|
||||
/** Holds if `sink` is a (potential) sink for the reachability analysis using variable `v`. */
|
||||
abstract predicate isSink(ControlFlowNode node, LocalScopeVariable v);
|
||||
|
||||
/** Holds if `node` is a barrier for the reachability analysis using variable `v`. */
|
||||
abstract predicate isBarrier(ControlFlowNode node, LocalScopeVariable v);
|
||||
|
||||
/**
|
||||
* Holds if the source node `source` can reach the sink `sink` without crossing
|
||||
* a barrier. This is (almost) equivalent to the following QL predicate but
|
||||
* uses basic blocks internally for better performance:
|
||||
*
|
||||
* ```
|
||||
* predicate reaches(ControlFlowNode source, SemanticStackVariable v, ControlFlowNode sink) {
|
||||
* reachesImpl(source, v, sink)
|
||||
* and
|
||||
* isSink(sink, v)
|
||||
* }
|
||||
*
|
||||
* predicate reachesImpl(ControlFlowNode source, SemanticStackVariable v, ControlFlowNode sink) {
|
||||
* sink = source.getASuccessor() and isSource(source, v)
|
||||
* or
|
||||
* exists(ControlFlowNode mid | reachesImpl(source, v, mid) |
|
||||
* not isBarrier(mid, v)
|
||||
* and
|
||||
* sink = mid.getASuccessor()
|
||||
* )
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* In addition to using a better performing implementation, this analysis
|
||||
* accounts for loops where the condition is provably true upon entry.
|
||||
*/
|
||||
predicate reaches(ControlFlowNode source, SemanticStackVariable v, ControlFlowNode sink) {
|
||||
/*
|
||||
* Implementation detail: the predicates in this class are a generalization of
|
||||
* those in DefinitionsAndUses.qll, and should be kept in sync.
|
||||
*
|
||||
* Unfortunately, caching of abstract predicates does not work well, so the
|
||||
* predicates in DefinitionsAndUses.qll cannot use this library.
|
||||
*/
|
||||
|
||||
exists(BasicBlock bb, int i |
|
||||
this.isSource(source, v) and
|
||||
bb.getNode(i) = source and
|
||||
not bb.isUnreachable()
|
||||
|
|
||||
exists(int j |
|
||||
j > i and
|
||||
sink = bb.getNode(j) and
|
||||
this.isSink(sink, v) and
|
||||
not exists(int k | this.isBarrier(bb.getNode(k), v) | k in [i + 1 .. j - 1])
|
||||
)
|
||||
or
|
||||
not exists(int k | this.isBarrier(bb.getNode(k), v) | k > i) and
|
||||
this.bbSuccessorEntryReaches(bb, v, sink, _)
|
||||
)
|
||||
}
|
||||
|
||||
private predicate bbSuccessorEntryReaches(
|
||||
BasicBlock bb, SemanticStackVariable v, ControlFlowNode node,
|
||||
boolean skipsFirstLoopAlwaysTrueUponEntry
|
||||
) {
|
||||
exists(BasicBlock succ, boolean succSkipsFirstLoopAlwaysTrueUponEntry |
|
||||
bbSuccessorEntryReachesLoopInvariant(bb, succ, skipsFirstLoopAlwaysTrueUponEntry,
|
||||
succSkipsFirstLoopAlwaysTrueUponEntry)
|
||||
|
|
||||
this.bbEntryReachesLocally(succ, v, node) and
|
||||
succSkipsFirstLoopAlwaysTrueUponEntry = false
|
||||
or
|
||||
not this.isBarrier(succ.getNode(_), v) and
|
||||
this.bbSuccessorEntryReaches(succ, v, node, succSkipsFirstLoopAlwaysTrueUponEntry)
|
||||
)
|
||||
}
|
||||
|
||||
private predicate bbEntryReachesLocally(
|
||||
BasicBlock bb, SemanticStackVariable v, ControlFlowNode node
|
||||
) {
|
||||
exists(int n |
|
||||
node = bb.getNode(n) and
|
||||
this.isSink(node, v)
|
||||
|
|
||||
not exists(this.firstBarrierIndexIn(bb, v))
|
||||
or
|
||||
n <= this.firstBarrierIndexIn(bb, v)
|
||||
)
|
||||
}
|
||||
|
||||
private int firstBarrierIndexIn(BasicBlock bb, SemanticStackVariable v) {
|
||||
result = min(int m | this.isBarrier(bb.getNode(m), v))
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `bb` contains the entry point `loop` for a loop at position `i`.
|
||||
* The condition of that loop is provably true upon entry but not provably
|
||||
@@ -211,183 +92,3 @@ predicate bbSuccessorEntryReachesLoopInvariant(
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `StackVariableReachabilityWithReassignment` instead.
|
||||
*
|
||||
* Reachability analysis for control-flow nodes involving stack variables.
|
||||
* Unlike `LocalScopeVariableReachability`, this analysis takes variable
|
||||
* reassignments into account.
|
||||
*
|
||||
* This class is used like `LocalScopeVariableReachability`, except that
|
||||
* subclasses should override `isSourceActual` and `isSinkActual` instead of
|
||||
* `isSource` and `isSink`, and that there is a `reachesTo` predicate in
|
||||
* addition to `reaches`.
|
||||
*/
|
||||
abstract deprecated class LocalScopeVariableReachabilityWithReassignment extends LocalScopeVariableReachability {
|
||||
bindingset[this]
|
||||
LocalScopeVariableReachabilityWithReassignment() { length() >= 0 }
|
||||
|
||||
/** Override this predicate rather than `isSource` (`isSource` is used internally). */
|
||||
abstract predicate isSourceActual(ControlFlowNode node, LocalScopeVariable v);
|
||||
|
||||
/** Override this predicate rather than `isSink` (`isSink` is used internally). */
|
||||
abstract predicate isSinkActual(ControlFlowNode node, LocalScopeVariable v);
|
||||
|
||||
/**
|
||||
* Holds if the source node `source` can reach the sink `sink` without crossing
|
||||
* a barrier, taking reassignments into account. This is (almost) equivalent
|
||||
* to the following QL predicate, but uses basic blocks internally for better
|
||||
* performance:
|
||||
*
|
||||
* ```
|
||||
* predicate reaches(ControlFlowNode source, SemanticStackVariable v, ControlFlowNode sink) {
|
||||
* reachesImpl(source, v, sink)
|
||||
* and
|
||||
* isSinkActual(sink, v)
|
||||
* }
|
||||
*
|
||||
* predicate reachesImpl(ControlFlowNode source, SemanticStackVariable v, ControlFlowNode sink) {
|
||||
* isSourceActual(source, v)
|
||||
* and
|
||||
* (
|
||||
* sink = source.getASuccessor()
|
||||
* or
|
||||
* exists(ControlFlowNode mid, SemanticStackVariable v0 | reachesImpl(source, v0, mid) |
|
||||
* // ordinary successor
|
||||
* not isBarrier(mid, v) and
|
||||
* sink = mid.getASuccessor() and
|
||||
* v = v0
|
||||
* or
|
||||
* // reassigned from v0 to v
|
||||
* exprDefinition(v, mid, v0.getAnAccess()) and
|
||||
* sink = mid.getASuccessor()
|
||||
* )
|
||||
* )
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* In addition to using a better performing implementation, this analysis
|
||||
* accounts for loops where the condition is provably true upon entry.
|
||||
*/
|
||||
override predicate reaches(ControlFlowNode source, SemanticStackVariable v, ControlFlowNode sink) {
|
||||
this.reachesTo(source, v, sink, _)
|
||||
}
|
||||
|
||||
/**
|
||||
* As `reaches`, but also specifies the last variable it was reassigned to (`v0`).
|
||||
*/
|
||||
predicate reachesTo(
|
||||
ControlFlowNode source, SemanticStackVariable v, ControlFlowNode sink, SemanticStackVariable v0
|
||||
) {
|
||||
exists(ControlFlowNode def |
|
||||
this.actualSourceReaches(source, v, def, v0) and
|
||||
LocalScopeVariableReachability.super.reaches(def, v0, sink) and
|
||||
this.isSinkActual(sink, v0)
|
||||
)
|
||||
}
|
||||
|
||||
private predicate actualSourceReaches(
|
||||
ControlFlowNode source, SemanticStackVariable v, ControlFlowNode def, SemanticStackVariable v0
|
||||
) {
|
||||
this.isSourceActual(source, v) and def = source and v0 = v
|
||||
or
|
||||
exists(ControlFlowNode source1, SemanticStackVariable v1 |
|
||||
this.actualSourceReaches(source, v, source1, v1)
|
||||
|
|
||||
this.reassignment(source1, v1, def, v0)
|
||||
)
|
||||
}
|
||||
|
||||
private predicate reassignment(
|
||||
ControlFlowNode source, SemanticStackVariable v, ControlFlowNode def, SemanticStackVariable v0
|
||||
) {
|
||||
LocalScopeVariableReachability.super.reaches(source, v, def) and
|
||||
exprDefinition(v0, def, v.getAnAccess())
|
||||
}
|
||||
|
||||
final override predicate isSource(ControlFlowNode node, LocalScopeVariable v) {
|
||||
this.isSourceActual(node, v)
|
||||
or
|
||||
// Reassignment generates a new (non-actual) source
|
||||
this.reassignment(_, _, node, v)
|
||||
}
|
||||
|
||||
final override predicate isSink(ControlFlowNode node, LocalScopeVariable v) {
|
||||
this.isSinkActual(node, v)
|
||||
or
|
||||
// Reassignment generates a new (non-actual) sink
|
||||
exprDefinition(_, node, v.getAnAccess())
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `StackVariableReachabilityExt` instead.
|
||||
*
|
||||
* Same as `LocalScopeVariableReachability`, but `isBarrier` works on control-flow
|
||||
* edges rather than nodes and is therefore parameterized by the original
|
||||
* source node as well. Otherwise, this class is used like
|
||||
* `LocalScopeVariableReachability`.
|
||||
*/
|
||||
abstract deprecated class LocalScopeVariableReachabilityExt extends string {
|
||||
bindingset[this]
|
||||
LocalScopeVariableReachabilityExt() { length() >= 0 }
|
||||
|
||||
/** `node` is a source for the reachability analysis using variable `v`. */
|
||||
abstract predicate isSource(ControlFlowNode node, LocalScopeVariable v);
|
||||
|
||||
/** `sink` is a (potential) sink for the reachability analysis using variable `v`. */
|
||||
abstract predicate isSink(ControlFlowNode node, LocalScopeVariable v);
|
||||
|
||||
/** `node` is a barrier for the reachability analysis using variable `v` and starting from `source`. */
|
||||
abstract predicate isBarrier(
|
||||
ControlFlowNode source, ControlFlowNode node, ControlFlowNode next, LocalScopeVariable v
|
||||
);
|
||||
|
||||
/** See `LocalScopeVariableReachability.reaches`. */
|
||||
predicate reaches(ControlFlowNode source, SemanticStackVariable v, ControlFlowNode sink) {
|
||||
exists(BasicBlock bb, int i |
|
||||
this.isSource(source, v) and
|
||||
bb.getNode(i) = source and
|
||||
not bb.isUnreachable()
|
||||
|
|
||||
exists(int j |
|
||||
j > i and
|
||||
sink = bb.getNode(j) and
|
||||
this.isSink(sink, v) and
|
||||
not exists(int k | this.isBarrier(source, bb.getNode(k), bb.getNode(k + 1), v) |
|
||||
k in [i .. j - 1]
|
||||
)
|
||||
)
|
||||
or
|
||||
not exists(int k | this.isBarrier(source, bb.getNode(k), bb.getNode(k + 1), v) | k >= i) and
|
||||
this.bbSuccessorEntryReaches(source, bb, v, sink, _)
|
||||
)
|
||||
}
|
||||
|
||||
private predicate bbSuccessorEntryReaches(
|
||||
ControlFlowNode source, BasicBlock bb, SemanticStackVariable v, ControlFlowNode node,
|
||||
boolean skipsFirstLoopAlwaysTrueUponEntry
|
||||
) {
|
||||
exists(BasicBlock succ, boolean succSkipsFirstLoopAlwaysTrueUponEntry |
|
||||
bbSuccessorEntryReachesLoopInvariant(bb, succ, skipsFirstLoopAlwaysTrueUponEntry,
|
||||
succSkipsFirstLoopAlwaysTrueUponEntry) and
|
||||
not this.isBarrier(source, bb.getEnd(), succ.getStart(), v)
|
||||
|
|
||||
this.bbEntryReachesLocally(source, succ, v, node) and
|
||||
succSkipsFirstLoopAlwaysTrueUponEntry = false
|
||||
or
|
||||
not exists(int k | this.isBarrier(source, succ.getNode(k), succ.getNode(k + 1), v)) and
|
||||
this.bbSuccessorEntryReaches(source, succ, v, node, succSkipsFirstLoopAlwaysTrueUponEntry)
|
||||
)
|
||||
}
|
||||
|
||||
private predicate bbEntryReachesLocally(
|
||||
ControlFlowNode source, BasicBlock bb, SemanticStackVariable v, ControlFlowNode node
|
||||
) {
|
||||
this.isSource(source, v) and
|
||||
exists(int n | node = bb.getNode(n) and this.isSink(node, v) |
|
||||
not exists(int m | m < n | this.isBarrier(source, bb.getNode(m), bb.getNode(m + 1), v))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,15 +156,6 @@ class AnalysedExpr extends Expr {
|
||||
this.isValidCheck(v) and result = this.getATrueSuccessor()
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `getNonNullSuccessor` instead, which does the same.
|
||||
*/
|
||||
deprecated ControlFlowNode getValidSuccessor(LocalScopeVariable v) {
|
||||
this.isValidCheck(v) and result = this.getATrueSuccessor()
|
||||
or
|
||||
this.isNullCheck(v) and result = this.getAFalseSuccessor()
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if this is a `VariableAccess` of `v` nested inside a condition.
|
||||
*/
|
||||
|
||||
@@ -147,15 +147,4 @@ class SsaDefinition extends ControlFlowNodeBase {
|
||||
Expr getAnUltimateDefiningValue(StackVariable v) {
|
||||
result = this.getAnUltimateSsaDefinition(v).getDefiningValue(v)
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: this is the old name for `getAnUltimateDefiningValue`. The
|
||||
* name was confusing as it seemed analogous to `getDefinition` rather than
|
||||
* `getDefiningValue`. The SSA libraries for other languages use the name
|
||||
* `getAnUltimateSsaDefinition` to refer to a predicate named
|
||||
* `getAnUltimateSsaDefinition` in this class.
|
||||
*/
|
||||
deprecated Expr getAnUltimateDefinition(StackVariable v) {
|
||||
result = this.getAnUltimateDefiningValue(v)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,9 +21,4 @@ import semmle.code.cpp.dataflow.DataFlow2
|
||||
module TaintTracking {
|
||||
import semmle.code.cpp.dataflow.internal.tainttracking1.TaintTrackingImpl
|
||||
private import semmle.code.cpp.dataflow.TaintTracking2
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use TaintTracking2::Configuration instead.
|
||||
*/
|
||||
deprecated class Configuration2 = TaintTracking2::Configuration;
|
||||
}
|
||||
|
||||
@@ -113,10 +113,6 @@ private module PartialDefinitions {
|
||||
abstract class PartialDefinition extends Expr {
|
||||
ControlFlowNode node;
|
||||
|
||||
abstract deprecated predicate partiallyDefines(Variable v);
|
||||
|
||||
abstract deprecated predicate partiallyDefinesThis(ThisExpr e);
|
||||
|
||||
/**
|
||||
* Gets the subBasicBlock where this `PartialDefinition` is defined.
|
||||
*/
|
||||
@@ -189,10 +185,6 @@ private module PartialDefinitions {
|
||||
)
|
||||
}
|
||||
|
||||
deprecated override predicate partiallyDefines(Variable v) { v = collection }
|
||||
|
||||
deprecated override predicate partiallyDefinesThis(ThisExpr e) { none() }
|
||||
|
||||
override predicate definesExpressions(Expr inner, Expr outer) {
|
||||
inner = innerDefinedExpr and
|
||||
outer = this
|
||||
@@ -217,12 +209,6 @@ private module PartialDefinitions {
|
||||
|
||||
VariablePartialDefinition() { innerDefinedExpr = getInnerDefinedExpr(this, node) }
|
||||
|
||||
deprecated override predicate partiallyDefines(Variable v) {
|
||||
innerDefinedExpr = v.getAnAccess()
|
||||
}
|
||||
|
||||
deprecated override predicate partiallyDefinesThis(ThisExpr e) { innerDefinedExpr = e }
|
||||
|
||||
/**
|
||||
* Holds if this partial definition may modify `inner` (or what it points
|
||||
* to) through `outer`. These expressions will never be `Conversion`s.
|
||||
|
||||
@@ -226,13 +226,6 @@ class AssignPointerSubExpr extends AssignOperation, @assignpsubexpr {
|
||||
* ```
|
||||
*/
|
||||
class ConditionDeclExpr extends Expr, @condition_decl {
|
||||
/**
|
||||
* DEPRECATED: Use `getVariableAccess()` or `getInitializingExpr()` instead.
|
||||
*
|
||||
* Gets the access using the condition for this declaration.
|
||||
*/
|
||||
deprecated Expr getExpr() { result = this.getChild(0) }
|
||||
|
||||
override string getAPrimaryQlClass() { result = "ConditionDeclExpr" }
|
||||
|
||||
/**
|
||||
|
||||
@@ -118,11 +118,6 @@ class BuiltInNoOp extends BuiltInOperation, @noopexpr {
|
||||
override string getAPrimaryQlClass() { result = "BuiltInNoOp" }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `BuiltInOperationBuiltInOffsetOf` instead.
|
||||
*/
|
||||
deprecated class BuiltInOperationOffsetOf = BuiltInOperationBuiltInOffsetOf;
|
||||
|
||||
/**
|
||||
* A C/C++ `__builtin_offsetof` built-in operation (used by some implementations
|
||||
* of `offsetof`). The operation retains its semantics even in the presence
|
||||
@@ -465,11 +460,6 @@ class BuiltInOperationIsUnion extends BuiltInOperation, @isunionexpr {
|
||||
override string getAPrimaryQlClass() { result = "BuiltInOperationIsUnion" }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `BuiltInOperationBuiltInTypesCompatibleP` instead.
|
||||
*/
|
||||
deprecated class BuiltInOperationBuiltInTypes = BuiltInOperationBuiltInTypesCompatibleP;
|
||||
|
||||
/**
|
||||
* A C++ `__builtin_types_compatible_p` built-in operation (used by some
|
||||
* implementations of the `<type_traits>` header).
|
||||
|
||||
@@ -666,13 +666,6 @@ class TypeidOperator extends Expr, @type_id {
|
||||
*/
|
||||
Type getResultType() { typeid_bind(underlyingElement(this), unresolveElement(result)) }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `getResultType()` instead.
|
||||
*
|
||||
* Gets the type that is returned by this typeid expression.
|
||||
*/
|
||||
deprecated Type getSpecifiedType() { result = this.getResultType() }
|
||||
|
||||
override string getAPrimaryQlClass() { result = "TypeidOperator" }
|
||||
|
||||
/**
|
||||
@@ -731,13 +724,6 @@ class SizeofExprOperator extends SizeofOperator {
|
||||
/** Gets the contained expression. */
|
||||
Expr getExprOperand() { result = this.getChild(0) }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `getExprOperand()` instead
|
||||
*
|
||||
* Gets the contained expression.
|
||||
*/
|
||||
deprecated Expr getExpr() { result = this.getExprOperand() }
|
||||
|
||||
override string toString() { result = "sizeof(<expr>)" }
|
||||
|
||||
override predicate mayBeImpure() { this.getExprOperand().mayBeImpure() }
|
||||
@@ -759,13 +745,6 @@ class SizeofTypeOperator extends SizeofOperator {
|
||||
/** Gets the contained type. */
|
||||
Type getTypeOperand() { sizeof_bind(underlyingElement(this), unresolveElement(result)) }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `getTypeOperand()` instead
|
||||
*
|
||||
* Gets the contained type.
|
||||
*/
|
||||
deprecated Type getSpecifiedType() { result = this.getTypeOperand() }
|
||||
|
||||
override string toString() { result = "sizeof(" + this.getTypeOperand().getName() + ")" }
|
||||
|
||||
override predicate mayBeImpure() { none() }
|
||||
@@ -794,11 +773,6 @@ class AlignofExprOperator extends AlignofOperator {
|
||||
*/
|
||||
Expr getExprOperand() { result = this.getChild(0) }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `getExprOperand()` instead.
|
||||
*/
|
||||
deprecated Expr getExpr() { result = this.getExprOperand() }
|
||||
|
||||
override string toString() { result = "alignof(<expr>)" }
|
||||
}
|
||||
|
||||
@@ -814,11 +788,6 @@ class AlignofTypeOperator extends AlignofOperator {
|
||||
/** Gets the contained type. */
|
||||
Type getTypeOperand() { sizeof_bind(underlyingElement(this), unresolveElement(result)) }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `getTypeOperand()` instead.
|
||||
*/
|
||||
deprecated Type getSpecifiedType() { result = this.getTypeOperand() }
|
||||
|
||||
override string toString() { result = "alignof(" + this.getTypeOperand().getName() + ")" }
|
||||
}
|
||||
|
||||
|
||||
@@ -48,16 +48,6 @@ class NEExpr extends EqualityOperation, @neexpr {
|
||||
class RelationalOperation extends ComparisonOperation, @rel_op_expr {
|
||||
override int getPrecedence() { result = 10 }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `getGreaterOperand()` instead.
|
||||
*/
|
||||
deprecated Expr getLarge() { result = getGreaterOperand() }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `getLesserOperand()` instead.
|
||||
*/
|
||||
deprecated Expr getSmall() { result = getLesserOperand() }
|
||||
|
||||
/**
|
||||
* Gets the operand on the "greater" (or "greater-or-equal") side
|
||||
* of this relational expression, that is, the side that is larger
|
||||
|
||||
@@ -114,13 +114,6 @@ class Expr extends StmtParent, @expr {
|
||||
*/
|
||||
Type getUnspecifiedType() { result = this.getType().getUnspecifiedType() }
|
||||
|
||||
/**
|
||||
* Gets an integer indicating the type of expression that this represents.
|
||||
*
|
||||
* DEPRECATED: use the subclasses of `Expr` rather than relying on this predicate.
|
||||
*/
|
||||
deprecated int getKind() { exprs(underlyingElement(this), result, _) }
|
||||
|
||||
/** Gets a textual representation of this expression. */
|
||||
override string toString() { none() }
|
||||
|
||||
|
||||
@@ -164,16 +164,6 @@ class HexLiteral extends Literal {
|
||||
class AggregateLiteral extends Expr, @aggregateliteral {
|
||||
override string getAPrimaryQlClass() { result = "AggregateLiteral" }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use ClassAggregateLiteral.getFieldExpr() instead.
|
||||
*
|
||||
* Gets the expression within the aggregate literal that is used to initialise field `f`,
|
||||
* if this literal is being used to initialise a class/struct instance.
|
||||
*/
|
||||
deprecated Expr getCorrespondingExpr(Field f) {
|
||||
result = this.(ClassAggregateLiteral).getFieldExpr(f)
|
||||
}
|
||||
|
||||
override predicate mayBeImpure() { this.getAChild().mayBeImpure() }
|
||||
|
||||
override predicate mayBeGloballyImpure() { this.getAChild().mayBeGloballyImpure() }
|
||||
|
||||
@@ -6,292 +6,3 @@ import semmle.code.cpp.exprs.Expr
|
||||
import semmle.code.cpp.Class
|
||||
import semmle.code.cpp.ObjectiveC
|
||||
private import semmle.code.cpp.internal.ResolveClass
|
||||
|
||||
/**
|
||||
* DEPRECATED: Objective-C is no longer supported.
|
||||
* An Objective C message expression, for example `[myColor changeColorToRed:5.0 green:2.0 blue:6.0]`.
|
||||
*/
|
||||
deprecated class MessageExpr extends Expr, Call {
|
||||
MessageExpr() { none() }
|
||||
|
||||
override string toString() { none() }
|
||||
|
||||
/**
|
||||
* Gets the selector of this message expression, for example `-changeColorToRed:green:blue:`.
|
||||
*/
|
||||
string getSelector() { none() }
|
||||
|
||||
/**
|
||||
* Gets the function invoked by this message expression, as inferred by the compiler.
|
||||
*
|
||||
* If the compiler could infer the type of the receiver, and that type had a method
|
||||
* whose name matched the selector, then the result of this predicate is said method.
|
||||
* Otherwise this predicate has no result.
|
||||
*
|
||||
* In all cases, actual function dispatch isn't performed until runtime, but the
|
||||
* lack of a static target is often cause for concern.
|
||||
*/
|
||||
MemberFunction getStaticTarget() { none() }
|
||||
|
||||
/**
|
||||
* Provided for compatibility with Call. It is the same as the static target.
|
||||
*/
|
||||
override MemberFunction getTarget() { none() }
|
||||
|
||||
/**
|
||||
* Holds if the compiler could infer a function as the target of this message.
|
||||
*
|
||||
* In all cases, actual function dispatch isn't performed until runtime, but the
|
||||
* lack of a static target is often cause for concern.
|
||||
*/
|
||||
predicate hasStaticTarget() { none() }
|
||||
|
||||
/**
|
||||
* Gets the number of arguments passed by this message expression.
|
||||
*
|
||||
* In most cases, this equals the number of colons in the selector, but this needn't be the
|
||||
* case for variadic methods like "-initWithFormat:", which can have more than one argument.
|
||||
*/
|
||||
override int getNumberOfArguments() { none() }
|
||||
|
||||
/**
|
||||
* Gets an argument passed by this message expression.
|
||||
*/
|
||||
override Expr getAnArgument() { none() }
|
||||
|
||||
/**
|
||||
* Gets the nth argument passed by this message expression.
|
||||
*
|
||||
* The range of `n` is [`0` .. `getNumberOfArguments()`].
|
||||
*/
|
||||
override Expr getArgument(int n) { none() }
|
||||
|
||||
override int getPrecedence() { none() }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Objective-C is no longer supported.
|
||||
* An Objective C message expression whose receiver is `super`, for example `[super init]`.
|
||||
*/
|
||||
deprecated class SuperMessageExpr extends MessageExpr {
|
||||
SuperMessageExpr() { none() }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Objective-C is no longer supported.
|
||||
* An Objective C message expression whose receiver is the name of a class, and
|
||||
* is therefore calling a class method rather than an instance method. This occurs
|
||||
* most commonly for the "+alloc", "+new", and "+class" selectors.
|
||||
*/
|
||||
deprecated class ClassMessageExpr extends MessageExpr {
|
||||
ClassMessageExpr() { none() }
|
||||
|
||||
/**
|
||||
* Gets the class which is the receiver of this message.
|
||||
*/
|
||||
Type getReceiver() { none() }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Objective-C is no longer supported.
|
||||
* An Objective C message expression whose receiver is an expression (which includes the
|
||||
* common case of the receiver being "self").
|
||||
*/
|
||||
deprecated class ExprMessageExpr extends MessageExpr {
|
||||
ExprMessageExpr() { none() }
|
||||
|
||||
/**
|
||||
* Gets the expression which gives the receiver of this message.
|
||||
*/
|
||||
Expr getReceiver() { none() }
|
||||
|
||||
/**
|
||||
* Gets the Objective C class of which the receiving expression is an instance.
|
||||
*
|
||||
* If the receiving expression has type `id` or type `id<P>` for some protocol `P`,
|
||||
* then there will be no result. If the receiving expression has type `C*` or type
|
||||
* `C<P>*` for some protocol `P`, then the result will be the type `C`.
|
||||
*/
|
||||
ObjectiveClass getReceiverClass() { none() }
|
||||
|
||||
/**
|
||||
* Gets the Objective C classes and/or protocols which are statically implemented
|
||||
* by the receiving expression.
|
||||
*
|
||||
* If the receiving expression has type `id`, then there will be no result.
|
||||
* If the receiving expression has type `id<P>`, then `P` will be the sole result.
|
||||
* If the receiving expression has type `C*`, then `C` will be the sole result.
|
||||
* If the receiving expression has type `C<P>*`, then `C` and `P` will both be results.
|
||||
*/
|
||||
Class getAReceiverClassOrProtocol() { none() }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Objective-C is no longer supported.
|
||||
* An access to an Objective C property using dot syntax.
|
||||
*
|
||||
* Such accesses are de-sugared into a message expression to the property's getter or setter.
|
||||
*/
|
||||
deprecated class PropertyAccess extends ExprMessageExpr {
|
||||
PropertyAccess() { none() }
|
||||
|
||||
/**
|
||||
* Gets the property being accessed by this expression.
|
||||
*/
|
||||
Property getProperty() { none() }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Objective-C is no longer supported.
|
||||
* An Objective C `@selector` expression, for example `@selector(driveForDistance:)`.
|
||||
*/
|
||||
deprecated class AtSelectorExpr extends Expr {
|
||||
AtSelectorExpr() { none() }
|
||||
|
||||
override string toString() { none() }
|
||||
|
||||
/**
|
||||
* Gets the selector of this `@selector` expression, for example `driveForDistance:`.
|
||||
*/
|
||||
string getSelector() { none() }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Objective-C is no longer supported.
|
||||
* An Objective C `@protocol` expression, for example `@protocol(SomeProtocol)`.
|
||||
*/
|
||||
deprecated class AtProtocolExpr extends Expr {
|
||||
AtProtocolExpr() { none() }
|
||||
|
||||
override string toString() { none() }
|
||||
|
||||
/**
|
||||
* Gets the protocol of this `@protocol` expression, for example `SomeProtocol`.
|
||||
*/
|
||||
Protocol getProtocol() { none() }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Objective-C is no longer supported.
|
||||
* An Objective C `@encode` expression, for example `@encode(int *)`.
|
||||
*/
|
||||
deprecated class AtEncodeExpr extends Expr {
|
||||
AtEncodeExpr() { none() }
|
||||
|
||||
override string toString() { none() }
|
||||
|
||||
/**
|
||||
* Gets the type this `@encode` expression encodes, for example `int *`.
|
||||
*/
|
||||
Type getEncodedType() { none() }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Objective-C is no longer supported.
|
||||
* An Objective C throw expression.
|
||||
*/
|
||||
deprecated class ObjcThrowExpr extends ThrowExpr {
|
||||
ObjcThrowExpr() { none() }
|
||||
|
||||
override string toString() { none() }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Objective-C is no longer supported.
|
||||
* An Objective C throw expression with no argument (which causes the
|
||||
* current exception to be re-thrown).
|
||||
*/
|
||||
deprecated class ObjcReThrowExpr extends ReThrowExpr, ObjcThrowExpr {
|
||||
ObjcReThrowExpr() { none() }
|
||||
|
||||
override string toString() { none() }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Objective-C is no longer supported.
|
||||
* An Objective C @ expression which boxes a single value, such as @(22).
|
||||
*/
|
||||
deprecated class AtExpr extends UnaryOperation {
|
||||
AtExpr() { none() }
|
||||
|
||||
override string toString() { none() }
|
||||
|
||||
override string getOperator() { none() }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Objective-C is no longer supported.
|
||||
* An Objective C @[...] literal.
|
||||
*/
|
||||
deprecated class ArrayLiteral extends Expr {
|
||||
ArrayLiteral() { none() }
|
||||
|
||||
/** Gets a textual representation of this array literal. */
|
||||
override string toString() { none() }
|
||||
|
||||
/** An element of the array */
|
||||
Expr getElement(int i) { none() }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Objective-C is no longer supported.
|
||||
* An Objective C @{...} literal.
|
||||
*/
|
||||
deprecated class DictionaryLiteral extends Expr {
|
||||
DictionaryLiteral() { none() }
|
||||
|
||||
/** Gets a textual representation of this dictionary literal. */
|
||||
override string toString() { none() }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Objective-C is no longer supported.
|
||||
* An Objective C @"..." string literal.
|
||||
*/
|
||||
deprecated class ObjCLiteralString extends TextLiteral {
|
||||
ObjCLiteralString() { none() }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Objective-C is no longer supported.
|
||||
* An Objective C/C++ overloaded subscripting access expression.
|
||||
*
|
||||
* Either
|
||||
* obj[idx]
|
||||
* or
|
||||
* obj[idx] = expr
|
||||
*/
|
||||
deprecated class SubscriptExpr extends Expr {
|
||||
SubscriptExpr() { none() }
|
||||
|
||||
/**
|
||||
* Gets the object expression being subscripted.
|
||||
*/
|
||||
Expr getSubscriptBase() { none() }
|
||||
|
||||
/**
|
||||
* Gets the expression giving the index into the object.
|
||||
*/
|
||||
Expr getSubscriptIndex() { none() }
|
||||
|
||||
/**
|
||||
* Gets the expression being assigned (if this is an assignment).
|
||||
*/
|
||||
Expr getAssignedExpr() { none() }
|
||||
|
||||
override string toString() { none() }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Objective-C is no longer supported.
|
||||
* An Objective C _cmd expression.
|
||||
*/
|
||||
deprecated class CmdExpr extends Expr {
|
||||
CmdExpr() { none() }
|
||||
|
||||
override string toString() { none() }
|
||||
|
||||
override predicate mayBeImpure() { none() }
|
||||
|
||||
override predicate mayBeGloballyImpure() { none() }
|
||||
}
|
||||
|
||||
@@ -39,19 +39,6 @@ class CorrectIncludeGuard extends IncludeGuardedHeader {
|
||||
PreprocessorEndif getEndif() { correctIncludeGuard(this, _, _, result, _) }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: no longer useful.
|
||||
*/
|
||||
deprecated class NotIncludedGuard extends IncludeGuardedHeader {
|
||||
NotIncludedGuard() { none() }
|
||||
|
||||
/** Gets the `#ifndef` directive used to prevent multiple inclusion of this file. */
|
||||
PreprocessorIfndef getIfndef() { result.getFile() = this }
|
||||
|
||||
/** Gets the `#endif` directive closing this file. */
|
||||
PreprocessorEndif getEndif() { result.getFile() = this }
|
||||
}
|
||||
|
||||
/**
|
||||
* A file with no code in it.
|
||||
*/
|
||||
|
||||
@@ -21,9 +21,4 @@ import semmle.code.cpp.ir.dataflow.DataFlow2
|
||||
module TaintTracking {
|
||||
import semmle.code.cpp.ir.dataflow.internal.tainttracking1.TaintTrackingImpl
|
||||
private import semmle.code.cpp.ir.dataflow.TaintTracking2
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use TaintTracking2::Configuration instead.
|
||||
*/
|
||||
deprecated class Configuration2 = TaintTracking2::Configuration;
|
||||
}
|
||||
|
||||
@@ -158,14 +158,6 @@ class Node extends TIRDataFlowNode {
|
||||
*/
|
||||
Expr asPartialDefinition() { result = this.(PartialDefinitionNode).getDefinedExpr() }
|
||||
|
||||
/**
|
||||
* DEPRECATED: See UninitializedNode.
|
||||
*
|
||||
* Gets the uninitialized local variable corresponding to this node, if
|
||||
* any.
|
||||
*/
|
||||
deprecated LocalVariable asUninitialized() { none() }
|
||||
|
||||
/**
|
||||
* Gets an upper bound on the type of this node.
|
||||
*/
|
||||
@@ -560,22 +552,6 @@ class ParameterIndirectionNode extends ParameterNode {
|
||||
override string toString() { result = "*" + instr.getIRVariable().toString() }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Data flow was never an accurate way to determine what
|
||||
* expressions might be uninitialized. It errs on the side of saying that
|
||||
* everything is uninitialized, and this is even worse in the IR because the IR
|
||||
* doesn't use syntactic hints to rule out variables that are definitely
|
||||
* initialized.
|
||||
*
|
||||
* The value of an uninitialized local variable, viewed as a node in a data
|
||||
* flow graph.
|
||||
*/
|
||||
deprecated class UninitializedNode extends Node {
|
||||
UninitializedNode() { none() }
|
||||
|
||||
LocalVariable getLocalVariable() { none() }
|
||||
}
|
||||
|
||||
/**
|
||||
* A node associated with an object after an operation that might have
|
||||
* changed its state.
|
||||
@@ -725,14 +701,6 @@ InstructionNode instructionNode(Instruction instr) { result.getInstruction() = i
|
||||
*/
|
||||
OperandNode operandNode(Operand operand) { result.getOperand() = operand }
|
||||
|
||||
/**
|
||||
* DEPRECATED: use `definitionByReferenceNodeFromArgument` instead.
|
||||
*
|
||||
* Gets the `Node` corresponding to a definition by reference of the variable
|
||||
* that is passed as `argument` of a call.
|
||||
*/
|
||||
deprecated DefinitionByReferenceNode definitionByReferenceNode(Expr e) { result.getArgument() = e }
|
||||
|
||||
/**
|
||||
* Gets the `Node` corresponding to the value of evaluating `e` or any of its
|
||||
* conversions. There is no result if `e` is a `Conversion`. For data flowing
|
||||
|
||||
@@ -77,15 +77,6 @@ private class Sprintf extends FormattingFunction {
|
||||
not exists(getDefinition().getFile().getRelativePath())
|
||||
}
|
||||
|
||||
deprecated override predicate isWideCharDefault() {
|
||||
getParameter(getFormatParameterIndex())
|
||||
.getType()
|
||||
.getUnspecifiedType()
|
||||
.(PointerType)
|
||||
.getBaseType()
|
||||
.getSize() > 1
|
||||
}
|
||||
|
||||
override int getFormatParameterIndex() {
|
||||
hasName("g_strdup_printf") and result = 0
|
||||
or
|
||||
@@ -133,15 +124,6 @@ private class SnprintfImpl extends Snprintf {
|
||||
else result = getFirstFormatArgumentIndex() - 1
|
||||
}
|
||||
|
||||
deprecated override predicate isWideCharDefault() {
|
||||
getParameter(getFormatParameterIndex())
|
||||
.getType()
|
||||
.getUnspecifiedType()
|
||||
.(PointerType)
|
||||
.getBaseType()
|
||||
.getSize() > 1
|
||||
}
|
||||
|
||||
override int getOutputParameterIndex(boolean isStream) { result = 0 and isStream = false }
|
||||
|
||||
override int getFirstFormatArgumentIndex() {
|
||||
@@ -182,15 +164,6 @@ private class StringCchPrintf extends FormattingFunction {
|
||||
if getName().matches("%Ex") then result = 5 else result = 2
|
||||
}
|
||||
|
||||
deprecated override predicate isWideCharDefault() {
|
||||
getParameter(getFormatParameterIndex())
|
||||
.getType()
|
||||
.getUnspecifiedType()
|
||||
.(PointerType)
|
||||
.getBaseType()
|
||||
.getSize() > 1
|
||||
}
|
||||
|
||||
override int getOutputParameterIndex(boolean isStream) { result = 0 and isStream = false }
|
||||
|
||||
override int getSizeParameterIndex() { result = 1 }
|
||||
|
||||
@@ -52,14 +52,6 @@ abstract class FormattingFunction extends ArrayFunction, TaintFunction {
|
||||
*/
|
||||
predicate isMicrosoft() { anyFileCompiledAsMicrosoft() }
|
||||
|
||||
/**
|
||||
* Holds if the default meaning of `%s` is a `wchar_t *`, rather than
|
||||
* a `char *` (either way, `%S` will have the opposite meaning).
|
||||
*
|
||||
* DEPRECATED: Use getDefaultCharType() instead.
|
||||
*/
|
||||
deprecated predicate isWideCharDefault() { none() }
|
||||
|
||||
/**
|
||||
* Gets the character type used in the format string for this function.
|
||||
*/
|
||||
@@ -116,13 +108,6 @@ abstract class FormattingFunction extends ArrayFunction, TaintFunction {
|
||||
*/
|
||||
int getOutputParameterIndex(boolean isStream) { none() }
|
||||
|
||||
/**
|
||||
* Gets the position at which the output parameter, if any, occurs.
|
||||
*
|
||||
* DEPRECATED: use `getOutputParameterIndex(boolean isStream)` instead.
|
||||
*/
|
||||
deprecated int getOutputParameterIndex() { result = getOutputParameterIndex(_) }
|
||||
|
||||
/**
|
||||
* Holds if this function outputs to a global stream such as standard output,
|
||||
* standard error or a system log. For example `printf`.
|
||||
|
||||
@@ -705,24 +705,6 @@ private float getTruncatedUpperBounds(Expr expr) {
|
||||
result = exprMaxVal(expr)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if the expression might overflow negatively. This predicate
|
||||
* does not consider the possibility that the expression might overflow
|
||||
* due to a conversion.
|
||||
*
|
||||
* DEPRECATED: use `exprMightOverflowNegatively` instead.
|
||||
*/
|
||||
deprecated predicate negative_overflow(Expr expr) { exprMightOverflowNegatively(expr) }
|
||||
|
||||
/**
|
||||
* Holds if the expression might overflow positively. This predicate
|
||||
* does not consider the possibility that the expression might overflow
|
||||
* due to a conversion.
|
||||
*
|
||||
* DEPRECATED: use `exprMightOverflowPositively` instead.
|
||||
*/
|
||||
deprecated predicate positive_overflow(Expr expr) { exprMightOverflowPositively(expr) }
|
||||
|
||||
/** Only to be called by `getTruncatedLowerBounds`. */
|
||||
private float getLowerBoundsImpl(Expr expr) {
|
||||
(
|
||||
|
||||
@@ -84,31 +84,3 @@ string getSecureAlgorithmRegex() {
|
||||
"(^|.*[A-Z]{2}|.*[^a-zA-Z0-9])(" + strictconcat(getASecureAlgorithmName().toLowerCase(), "|") +
|
||||
")([^a-z0-9].*|$)"
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Terminology has been updated. Use `getAnInsecureAlgorithmName()`
|
||||
* instead.
|
||||
*/
|
||||
deprecated string algorithmBlacklist() { result = getAnInsecureAlgorithmName() }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Terminology has been updated. Use
|
||||
* `getAnInsecureHashAlgorithmName()` instead.
|
||||
*/
|
||||
deprecated string hashAlgorithmBlacklist() { result = getAnInsecureHashAlgorithmName() }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Terminology has been updated. Use `getInsecureAlgorithmRegex()` instead.
|
||||
*/
|
||||
deprecated string algorithmBlacklistRegex() { result = getInsecureAlgorithmRegex() }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Terminology has been updated. Use `getASecureAlgorithmName()`
|
||||
* instead.
|
||||
*/
|
||||
deprecated string algorithmWhitelist() { result = getASecureAlgorithmName() }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Terminology has been updated. Use `getSecureAlgorithmRegex()` instead.
|
||||
*/
|
||||
deprecated string algorithmWhitelistRegex() { result = getSecureAlgorithmRegex() }
|
||||
|
||||
@@ -126,9 +126,3 @@ class BlockStmt extends Stmt, @stmt_block {
|
||||
|
||||
override predicate mayBeGloballyImpure() { this.getAStmt().mayBeGloballyImpure() }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: This is now called `BlockStmt` to avoid confusion with
|
||||
* `BasicBlock`.
|
||||
*/
|
||||
deprecated class Block = BlockStmt;
|
||||
|
||||
@@ -61,13 +61,6 @@ class Stmt extends StmtParent, @stmt {
|
||||
|
||||
override Location getLocation() { stmts(underlyingElement(this), _, result) }
|
||||
|
||||
/**
|
||||
* Gets an int indicating the type of statement that this represents.
|
||||
*
|
||||
* DEPRECATED: use the subclasses of `Stmt` rather than relying on this predicate.
|
||||
*/
|
||||
deprecated int getKind() { stmts(underlyingElement(this), result, _) }
|
||||
|
||||
override string toString() { none() }
|
||||
|
||||
override Function getControlFlowScope() { result = this.getEnclosingFunction() }
|
||||
@@ -1230,38 +1223,6 @@ class SwitchCase extends Stmt, @stmt_switch_case {
|
||||
*/
|
||||
int getChildNum() { switch_case(_, result, underlyingElement(this)) }
|
||||
|
||||
/**
|
||||
* DEPRECATED: use `SwitchCase.getAStmt` or `ControlFlowNode.getASuccessor`
|
||||
* rather than this predicate.
|
||||
*
|
||||
* Gets the `BlockStmt` statement immediately following this 'switch case'
|
||||
* statement, if any.
|
||||
*
|
||||
* For example, for
|
||||
* ```
|
||||
* switch (i) {
|
||||
* case 5:
|
||||
* x = 1;
|
||||
* break;
|
||||
* case 6:
|
||||
* case 7:
|
||||
* { x = 2; break; }
|
||||
* default:
|
||||
* { x = 3; }
|
||||
* x = 4;
|
||||
* break;
|
||||
* }
|
||||
* ```
|
||||
* the `case 7:` has result `{ x = 2; break; }`, `default:` has result
|
||||
* `{ x = 3; }`, and the others have no result.
|
||||
*/
|
||||
deprecated BlockStmt getLabelledStmt() {
|
||||
exists(int i, Stmt parent |
|
||||
this = parent.getChild(i) and
|
||||
result = parent.getChild(i + 1)
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the next `SwitchCase` belonging to the same 'switch'
|
||||
* statement, if any.
|
||||
@@ -1741,23 +1702,6 @@ class Handler extends Stmt, @stmt_handler {
|
||||
override predicate mayBeGloballyImpure() { none() }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Objective-C is no longer supported.
|
||||
* The end of a 'finally' clause.
|
||||
*
|
||||
* This has no concrete representation in the source, but makes the
|
||||
* control flow graph easier to use.
|
||||
*/
|
||||
deprecated class FinallyEnd extends Stmt {
|
||||
FinallyEnd() { none() }
|
||||
|
||||
override string toString() { result = "<finally end>" }
|
||||
|
||||
override predicate mayBeImpure() { none() }
|
||||
|
||||
override predicate mayBeGloballyImpure() { none() }
|
||||
}
|
||||
|
||||
/**
|
||||
* A C/C++ 'try' statement.
|
||||
*
|
||||
|
||||
@@ -23,13 +23,6 @@ class Declaration extends DotNet::Declaration, Element, @cil_declaration {
|
||||
}
|
||||
|
||||
override Declaration getUnboundDeclaration() { result = this }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `isUnboundDeclaration()` instead.
|
||||
*
|
||||
* Holds if this declaration is a source declaration.
|
||||
*/
|
||||
deprecated final predicate isSourceDeclaration() { this.isUnboundDeclaration() }
|
||||
}
|
||||
|
||||
private CS::Declaration toCSharpNonTypeParameter(Declaration d) { result.matchesHandle(d) }
|
||||
|
||||
@@ -64,11 +64,6 @@ class Callable extends DotNet::Callable, Parameterizable, ExprOrStmtParent, @cal
|
||||
result = this.getExpressionBody()
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `getBody()` instead.
|
||||
*/
|
||||
deprecated final ControlFlowElement getABody() { result = this.getBody() }
|
||||
|
||||
override predicate hasBody() { exists(this.getBody()) }
|
||||
|
||||
/**
|
||||
@@ -151,11 +146,6 @@ class Callable extends DotNet::Callable, Parameterizable, ExprOrStmtParent, @cal
|
||||
not result = this.(Constructor).getInitializer()
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `getExpressionBody()` instead.
|
||||
*/
|
||||
deprecated final Expr getAnExpressionBody() { result = this.getExpressionBody() }
|
||||
|
||||
/** Holds if this callable has an expression body. */
|
||||
final predicate hasExpressionBody() { exists(this.getExpressionBody()) }
|
||||
|
||||
|
||||
@@ -12,13 +12,6 @@ class XMLLocatable extends @xmllocatable, TXMLLocatable {
|
||||
/** Gets the source location for this element. */
|
||||
Location getLocation() { xmllocations(this, result) }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `getLocation()` instead.
|
||||
*
|
||||
* Gets the source location for this element.
|
||||
*/
|
||||
deprecated Location getALocation() { result = this.getLocation() }
|
||||
|
||||
/**
|
||||
* Holds if this element is at the specified location.
|
||||
* The location spans column `startcolumn` of line `startline` to
|
||||
@@ -83,21 +76,6 @@ class XMLParent extends @xmlparent {
|
||||
/** Gets the number of places in the body of this XML parent where text occurs. */
|
||||
int getNumberOfCharacterSets() { result = count(int pos | xmlChars(_, _, this, pos, _, _)) }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Internal.
|
||||
*
|
||||
* Append the character sequences of this XML parent from left to right, separated by a space,
|
||||
* up to a specified (zero-based) index.
|
||||
*/
|
||||
deprecated string charsSetUpTo(int n) {
|
||||
n = 0 and xmlChars(_, result, this, 0, _, _)
|
||||
or
|
||||
n > 0 and
|
||||
exists(string chars | xmlChars(_, chars, this, n, _, _) |
|
||||
result = this.charsSetUpTo(n - 1) + " " + chars
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the result of appending all the character sequences of this XML parent from
|
||||
* left to right, separated by a space.
|
||||
|
||||
@@ -59,13 +59,6 @@ abstract class AssertMethod extends Method {
|
||||
|
||||
/** Gets the failure type if the assertion fails for argument `i`, if any. */
|
||||
abstract AssertionFailure getAssertionFailure(int i);
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `getAssertionFailure(_)` instead.
|
||||
*
|
||||
* Gets the exception being thrown if the assertion fails, if any.
|
||||
*/
|
||||
deprecated final Class getExceptionClass() { this.getAssertionFailure(_).isException(result) }
|
||||
}
|
||||
|
||||
/** A Boolean assertion method. */
|
||||
@@ -76,34 +69,6 @@ abstract class BooleanAssertMethod extends AssertMethod {
|
||||
override int getAnAssertionIndex() { result = this.getAnAssertionIndex(_) }
|
||||
}
|
||||
|
||||
/** A positive assertion method. */
|
||||
deprecated class AssertTrueMethod extends AssertMethod {
|
||||
private BooleanAssertMethod m;
|
||||
|
||||
AssertTrueMethod() {
|
||||
this = m and
|
||||
exists(m.getAnAssertionIndex(true))
|
||||
}
|
||||
|
||||
final override int getAnAssertionIndex() { result = m.getAnAssertionIndex() }
|
||||
|
||||
final override AssertionFailure getAssertionFailure(int i) { result = m.getAssertionFailure(i) }
|
||||
}
|
||||
|
||||
/** A negated assertion method. */
|
||||
deprecated class AssertFalseMethod extends AssertMethod {
|
||||
private BooleanAssertMethod m;
|
||||
|
||||
AssertFalseMethod() {
|
||||
this = m and
|
||||
exists(m.getAnAssertionIndex(false))
|
||||
}
|
||||
|
||||
final override int getAnAssertionIndex() { result = m.getAnAssertionIndex() }
|
||||
|
||||
final override AssertionFailure getAssertionFailure(int i) { result = m.getAssertionFailure(i) }
|
||||
}
|
||||
|
||||
/** A nullness assertion method. */
|
||||
abstract class NullnessAssertMethod extends AssertMethod {
|
||||
/**
|
||||
@@ -115,34 +80,6 @@ abstract class NullnessAssertMethod extends AssertMethod {
|
||||
override int getAnAssertionIndex() { result = this.getAnAssertionIndex(_) }
|
||||
}
|
||||
|
||||
/** A `null` assertion method. */
|
||||
deprecated class AssertNullMethod extends AssertMethod {
|
||||
private NullnessAssertMethod m;
|
||||
|
||||
AssertNullMethod() {
|
||||
this = m and
|
||||
exists(m.getAnAssertionIndex(true))
|
||||
}
|
||||
|
||||
final override int getAnAssertionIndex() { result = m.getAnAssertionIndex() }
|
||||
|
||||
final override AssertionFailure getAssertionFailure(int i) { result = m.getAssertionFailure(i) }
|
||||
}
|
||||
|
||||
/** A non-`null` assertion method. */
|
||||
deprecated class AssertNonNullMethod extends AssertMethod {
|
||||
private NullnessAssertMethod m;
|
||||
|
||||
AssertNonNullMethod() {
|
||||
this = m and
|
||||
exists(m.getAnAssertionIndex(false))
|
||||
}
|
||||
|
||||
final override int getAnAssertionIndex() { result = m.getAnAssertionIndex() }
|
||||
|
||||
final override AssertionFailure getAssertionFailure(int i) { result = m.getAssertionFailure(i) }
|
||||
}
|
||||
|
||||
/** An assertion, that is, a call to an assertion method. */
|
||||
class Assertion extends MethodCall {
|
||||
private AssertMethod target;
|
||||
@@ -160,108 +97,6 @@ class Assertion extends MethodCall {
|
||||
result = this.getArgumentForParameter(p)
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `getExpr(_)` instead.
|
||||
*
|
||||
* Gets an expression that this assertion pertains to.
|
||||
*/
|
||||
deprecated Expr getExpr() { result = this.getExpr(_) }
|
||||
|
||||
/**
|
||||
* Holds if basic block `succ` is immediately dominated by this assertion.
|
||||
* That is, `succ` can only be reached from the callable entry point by
|
||||
* going via *some* basic block `pred` containing this assertion, and `pred`
|
||||
* is an immediate predecessor of `succ`.
|
||||
*
|
||||
* Moreover, this assertion corresponds to multiple control flow nodes,
|
||||
* which is why
|
||||
*
|
||||
* ```ql
|
||||
* exists(BasicBlock bb |
|
||||
* bb.getANode() = this.getAControlFlowNode() |
|
||||
* bb.immediatelyDominates(succ)
|
||||
* )
|
||||
* ```
|
||||
*
|
||||
* does not work.
|
||||
*/
|
||||
pragma[nomagic]
|
||||
deprecated private predicate immediatelyDominatesBlockSplit(BasicBlock succ) {
|
||||
// Only calculate dominance by explicit recursion for split nodes;
|
||||
// all other nodes can use regular CFG dominance
|
||||
this instanceof SplitControlFlowElement and
|
||||
exists(BasicBlock bb | bb.getANode() = this.getAControlFlowNode() |
|
||||
succ = bb.getASuccessor() and
|
||||
forall(BasicBlock pred | pred = succ.getAPredecessor() and pred != bb |
|
||||
succ.dominates(pred)
|
||||
or
|
||||
// `pred` might be another split of this element
|
||||
pred.getANode().getElement() = this
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
pragma[noinline]
|
||||
deprecated private predicate strictlyDominatesJoinBlockPredecessor(JoinBlock jb, int i) {
|
||||
this.strictlyDominatesSplit(jb.getJoinBlockPredecessor(i))
|
||||
}
|
||||
|
||||
deprecated private predicate strictlyDominatesJoinBlockSplit(JoinBlock jb, int i) {
|
||||
i = -1 and
|
||||
this.strictlyDominatesJoinBlockPredecessor(jb, _)
|
||||
or
|
||||
this.strictlyDominatesJoinBlockSplit(jb, i - 1) and
|
||||
(
|
||||
this.strictlyDominatesJoinBlockPredecessor(jb, i)
|
||||
or
|
||||
this.getAControlFlowNode().getBasicBlock() = jb.getJoinBlockPredecessor(i)
|
||||
)
|
||||
}
|
||||
|
||||
pragma[nomagic]
|
||||
deprecated private predicate strictlyDominatesSplit(BasicBlock bb) {
|
||||
this.immediatelyDominatesBlockSplit(bb)
|
||||
or
|
||||
// Equivalent with
|
||||
//
|
||||
// ```ql
|
||||
// exists(JoinBlockPredecessor pred | pred = bb.getAPredecessor() |
|
||||
// this.strictlyDominatesSplit(pred)
|
||||
// ) and
|
||||
// forall(JoinBlockPredecessor pred | pred = bb.getAPredecessor() |
|
||||
// this.strictlyDominatesSplit(pred)
|
||||
// or
|
||||
// this.getAControlFlowNode().getBasicBlock() = pred
|
||||
// )
|
||||
// ```
|
||||
//
|
||||
// but uses no universal recursion for better performance.
|
||||
exists(int last | last = max(int i | exists(bb.(JoinBlock).getJoinBlockPredecessor(i))) |
|
||||
this.strictlyDominatesJoinBlockSplit(bb, last)
|
||||
)
|
||||
or
|
||||
not bb instanceof JoinBlock and
|
||||
this.strictlyDominatesSplit(bb.getAPredecessor())
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `getExpr().controlsBlock()` instead.
|
||||
*
|
||||
* Holds if this assertion strictly dominates basic block `bb`. That is, `bb`
|
||||
* can only be reached from the callable entry point by going via *some* basic
|
||||
* block containing this element.
|
||||
*
|
||||
* This predicate is different from
|
||||
* `this.getAControlFlowNode().getBasicBlock().strictlyDominates(bb)`
|
||||
* in that it takes control flow splitting into account.
|
||||
*/
|
||||
pragma[nomagic]
|
||||
deprecated predicate strictlyDominates(BasicBlock bb) {
|
||||
this.strictlyDominatesSplit(bb)
|
||||
or
|
||||
this.getAControlFlowNode().getBasicBlock().strictlyDominates(bb)
|
||||
}
|
||||
}
|
||||
|
||||
/** A trivially failing assertion, for example `Debug.Assert(false)`. */
|
||||
@@ -551,16 +386,6 @@ class ForwarderBooleanAssertMethod extends BooleanAssertMethod {
|
||||
}
|
||||
}
|
||||
|
||||
/** A method that forwards to a positive assertion method. */
|
||||
deprecated class ForwarderAssertTrueMethod extends ForwarderBooleanAssertMethod {
|
||||
ForwarderAssertTrueMethod() { exists(this.getAnAssertionIndex(true)) }
|
||||
}
|
||||
|
||||
/** A method that forwards to a negated assertion method. */
|
||||
deprecated class ForwarderAssertFalseMethod extends ForwarderBooleanAssertMethod {
|
||||
ForwarderAssertFalseMethod() { exists(this.getAnAssertionIndex(false)) }
|
||||
}
|
||||
|
||||
/** A method that forwards to a nullness assertion method. */
|
||||
class ForwarderNullnessAssertMethod extends NullnessAssertMethod {
|
||||
private ForwarderAssertMethod forwarder;
|
||||
@@ -580,15 +405,5 @@ class ForwarderNullnessAssertMethod extends NullnessAssertMethod {
|
||||
}
|
||||
}
|
||||
|
||||
/** A method that forwards to a `null` assertion method. */
|
||||
deprecated class ForwarderAssertNullMethod extends ForwarderNullnessAssertMethod {
|
||||
ForwarderAssertNullMethod() { exists(this.getAnAssertionIndex(true)) }
|
||||
}
|
||||
|
||||
/** A method that forwards to a non-`null` assertion method. */
|
||||
deprecated class ForwarderAssertNonNullMethod extends ForwarderNullnessAssertMethod {
|
||||
ForwarderAssertNonNullMethod() { exists(this.getAnAssertionIndex(false)) }
|
||||
}
|
||||
|
||||
/** Holds if expression `e` appears in an assertion. */
|
||||
predicate isExprInAssertion(Expr e) { e = any(Assertion a).getExpr(_).getAChildExpr*() }
|
||||
|
||||
@@ -227,35 +227,5 @@ class ControlFlowElement extends ExprOrStmtParent, @control_flow_element {
|
||||
cb.getLastNode() = this.getAControlFlowNode() and
|
||||
cb.controls(controlled, s)
|
||||
}
|
||||
|
||||
/** DEPRECATED: Use `controlsBlock/3` instead. */
|
||||
deprecated predicate controlsBlock(BasicBlock controlled, ConditionalSuccessor s) {
|
||||
this.controlsBlock(controlled, s, _)
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED.
|
||||
*
|
||||
* Holds if control flow element `controlled` is controlled by this control flow
|
||||
* element with conditional value `s`. That is, `controlled` can only be reached
|
||||
* from the callable entry point by going via the `s` edge out of this element.
|
||||
*
|
||||
* This predicate is different from
|
||||
*
|
||||
* ```ql
|
||||
* exists(ConditionBlock cb |
|
||||
* cb.getLastNode() = this.getAControlFlowNode() |
|
||||
* cb.controls(controlled.getAControlFlowNode().getBasicBlock(), s)
|
||||
* )
|
||||
* ```
|
||||
*
|
||||
* as control flow splitting is taken into account.
|
||||
*/
|
||||
// potentially very large predicate, so must be inlined
|
||||
pragma[inline]
|
||||
deprecated predicate controlsElement(ControlFlowElement controlled, ConditionalSuccessor s) {
|
||||
forex(BasicBlock bb | bb = controlled.getAControlFlowNode().getBasicBlock() |
|
||||
this.controlsBlock(bb, s)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,9 +26,6 @@ private newtype TSuccessorType =
|
||||
class SuccessorType extends TSuccessorType {
|
||||
/** Gets a textual representation of successor type. */
|
||||
string toString() { none() }
|
||||
|
||||
/** Holds if this successor type matches completion `c`. */
|
||||
deprecated predicate matchesCompletion(Completion c) { this = c.getAMatchingSuccessorType() }
|
||||
}
|
||||
|
||||
/** Provides different types of control flow successor types. */
|
||||
|
||||
@@ -427,11 +427,6 @@ module Ssa {
|
||||
not result instanceof PhiNode
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `definesAt/3` instead.
|
||||
*/
|
||||
deprecated predicate definesAt(ControlFlow::BasicBlock bb, int i) { this.definesAt(_, bb, i) }
|
||||
|
||||
/**
|
||||
* Gets the syntax element associated with this SSA definition, if any.
|
||||
* This is either an expression, for example `x = 0`, a parameter, or a
|
||||
@@ -655,14 +650,6 @@ module Ssa {
|
||||
override Location getLocation() { result = this.getQualifierDefinition().getLocation() }
|
||||
}
|
||||
|
||||
/**
|
||||
* An SSA definition that has no actual semantics, but simply serves to
|
||||
* merge or filter data flow.
|
||||
*
|
||||
* Phi nodes are the canonical (and currently only) example.
|
||||
*/
|
||||
deprecated class PseudoDefinition = PhiNode;
|
||||
|
||||
/**
|
||||
* An SSA phi node, that is, a pseudo definition for a variable at a point
|
||||
* in the flow graph where otherwise two or more definitions for the variable
|
||||
|
||||
@@ -204,12 +204,6 @@ class Content extends TContent {
|
||||
|
||||
/** Gets the location of this content. */
|
||||
Location getLocation() { none() }
|
||||
|
||||
/** Gets the type of the object containing this content. */
|
||||
deprecated Gvn::GvnType getContainerType() { none() }
|
||||
|
||||
/** Gets the type of this content. */
|
||||
deprecated Gvn::GvnType getType() { none() }
|
||||
}
|
||||
|
||||
/** A reference to a field. */
|
||||
@@ -224,12 +218,6 @@ class FieldContent extends Content, TFieldContent {
|
||||
override string toString() { result = "field " + f.getName() }
|
||||
|
||||
override Location getLocation() { result = f.getLocation() }
|
||||
|
||||
deprecated override Gvn::GvnType getContainerType() {
|
||||
result = Gvn::getGlobalValueNumber(f.getDeclaringType())
|
||||
}
|
||||
|
||||
deprecated override Gvn::GvnType getType() { result = Gvn::getGlobalValueNumber(f.getType()) }
|
||||
}
|
||||
|
||||
/** A reference to a synthetic field. */
|
||||
@@ -256,12 +244,6 @@ class PropertyContent extends Content, TPropertyContent {
|
||||
override string toString() { result = "property " + p.getName() }
|
||||
|
||||
override Location getLocation() { result = p.getLocation() }
|
||||
|
||||
deprecated override Gvn::GvnType getContainerType() {
|
||||
result = Gvn::getGlobalValueNumber(p.getDeclaringType())
|
||||
}
|
||||
|
||||
deprecated override Gvn::GvnType getType() { result = Gvn::getGlobalValueNumber(p.getType()) }
|
||||
}
|
||||
|
||||
/** A reference to an element in a collection. */
|
||||
|
||||
@@ -31,8 +31,6 @@ predicate defaultTaintSanitizerGuard(DataFlow::BarrierGuard guard) { none() }
|
||||
bindingset[node]
|
||||
predicate defaultImplicitTaintRead(DataFlow::Node node, DataFlow::Content c) { none() }
|
||||
|
||||
deprecated predicate localAdditionalTaintStep = defaultAdditionalTaintStep/2;
|
||||
|
||||
private CIL::DataFlowNode asCilDataFlowNode(DataFlow::Node node) {
|
||||
result = node.asParameter() or
|
||||
result = node.asExpr()
|
||||
|
||||
@@ -170,40 +170,6 @@ class InvalidFormatString extends StringLiteral {
|
||||
}
|
||||
}
|
||||
|
||||
/** Provides a dataflow configuration for format strings. */
|
||||
deprecated module FormatFlow {
|
||||
private import semmle.code.csharp.dataflow.DataFlow
|
||||
|
||||
private class FormatConfiguration extends DataFlow2::Configuration {
|
||||
FormatConfiguration() { this = "format" }
|
||||
|
||||
override predicate isSource(DataFlow::Node n) { n.asExpr() instanceof StringLiteral }
|
||||
|
||||
override predicate isSink(DataFlow::Node n) {
|
||||
exists(FormatCall c | n.asExpr() = c.getFormatExpr())
|
||||
}
|
||||
}
|
||||
|
||||
deprecated query predicate nodes = DataFlow2::PathGraph::nodes/3;
|
||||
|
||||
deprecated query predicate edges = DataFlow2::PathGraph::edges/2;
|
||||
|
||||
deprecated class PathNode = DataFlow2::PathNode;
|
||||
|
||||
/**
|
||||
* Holds if there is flow from string literal `lit` to the format string in
|
||||
* `call`. `litNode` and `formatNode` are the corresponding data-flow path
|
||||
* nodes.
|
||||
*/
|
||||
deprecated predicate hasFlowPath(
|
||||
StringLiteral lit, PathNode litNode, FormatCall call, PathNode formatNode
|
||||
) {
|
||||
litNode.getNode().asExpr() = lit and
|
||||
formatNode.getNode().asExpr() = call.getFormatExpr() and
|
||||
any(FormatConfiguration conf).hasFlowPath(litNode, formatNode)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A method call to a method that formats a string, for example a call
|
||||
* to `string.Format()`.
|
||||
@@ -229,14 +195,6 @@ class FormatCall extends MethodCall {
|
||||
this.getArgument(this.getFirstArgument()).getType() instanceof ArrayType
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `FormatFlow::hasFlowPath()` instead.
|
||||
*
|
||||
* Gets a format string. Global data flow analysis is applied to retrieve all
|
||||
* sources that can reach this method call.
|
||||
*/
|
||||
deprecated StringLiteral getAFormatSource() { FormatFlow::hasFlowPath(result, _, this, _) }
|
||||
|
||||
/**
|
||||
* Gets the number of supplied arguments (excluding the format string and format
|
||||
* provider). Does not return a value if the arguments are supplied in an array,
|
||||
@@ -255,11 +213,4 @@ class FormatCall extends MethodCall {
|
||||
index = this.getASuppliedArgument() and
|
||||
result = this.getArgument(this.getFirstArgument() + index)
|
||||
}
|
||||
|
||||
/** Gets a supplied argument that is not used in the format string `src`. */
|
||||
deprecated int getAnUnusedArgument(ValidFormatString src) {
|
||||
result = this.getASuppliedArgument() and
|
||||
FormatFlow::hasFlowPath(src, _, this, _) and
|
||||
not result = src.getAnInsert()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,13 +21,6 @@ class Declaration extends NamedElement, @dotnet_declaration {
|
||||
/** Gets the type containing this declaration, if any. */
|
||||
Type getDeclaringType() { none() }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `getUnboundDeclaration()` instaed.
|
||||
*
|
||||
* Gets the unbound version of this declaration.
|
||||
*/
|
||||
deprecated final Declaration getSourceDeclaration() { result = this.getUnboundDeclaration() }
|
||||
|
||||
/**
|
||||
* Gets the unbound version of this declaration, that is, the declaration where
|
||||
* all type arguments have been removed. For example, in
|
||||
|
||||
@@ -82,12 +82,6 @@ class BlockStmt extends Stmt, @block {
|
||||
override string getAPrimaryQlClass() { result = "BlockStmt" }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: This is now called `BlockStmt` to avoid confusion with
|
||||
* `BasicBlock`.
|
||||
*/
|
||||
deprecated class Block = BlockStmt;
|
||||
|
||||
/** A block with only a single statement. */
|
||||
class SingletonBlock extends BlockStmt {
|
||||
SingletonBlock() { this.getNumStmt() = 1 }
|
||||
@@ -103,14 +97,6 @@ class SingletonBlock extends BlockStmt {
|
||||
abstract class ConditionalStmt extends Stmt {
|
||||
/** Gets the boolean condition of this conditional statement. */
|
||||
abstract Expr getCondition();
|
||||
|
||||
/**
|
||||
* Gets the statement that is executed whenever the condition
|
||||
* of this branch statement evaluates to `true`.
|
||||
*
|
||||
* DEPRECATED: use `ConditionNode.getATrueSuccessor()` instead.
|
||||
*/
|
||||
abstract deprecated Stmt getTrueSuccessor();
|
||||
}
|
||||
|
||||
/** An `if` statement. */
|
||||
|
||||
@@ -244,34 +244,6 @@ string getSecureAlgorithmRegex() {
|
||||
result = algorithmRegex(secureAlgorithmString(max(int i | exists(rankedSecureAlgorithm(i)))))
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Terminology has been updated. Use `getAnInsecureAlgorithmName()`
|
||||
* instead.
|
||||
*/
|
||||
deprecated string algorithmBlacklist() { result = getAnInsecureAlgorithmName() }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Terminology has been updated. Use
|
||||
* `getAnInsecureHashAlgorithmName()` instead.
|
||||
*/
|
||||
deprecated string hashAlgorithmBlacklist() { result = getAnInsecureHashAlgorithmName() }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Terminology has been updated. Use `getInsecureAlgorithmRegex()` instead.
|
||||
*/
|
||||
deprecated string algorithmBlacklistRegex() { result = getInsecureAlgorithmRegex() }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Terminology has been updated. Use `getASecureAlgorithmName()`
|
||||
* instead.
|
||||
*/
|
||||
deprecated string algorithmWhitelist() { result = getASecureAlgorithmName() }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Terminology has been updated. Use `getSecureAlgorithmRegex()` instead.
|
||||
*/
|
||||
deprecated string algorithmWhitelistRegex() { result = getSecureAlgorithmRegex() }
|
||||
|
||||
/**
|
||||
* Any use of a cryptographic element that specifies an encryption
|
||||
* algorithm. For example, methods returning ciphers, decryption methods,
|
||||
|
||||
@@ -12,13 +12,6 @@ class XMLLocatable extends @xmllocatable, TXMLLocatable {
|
||||
/** Gets the source location for this element. */
|
||||
Location getLocation() { xmllocations(this, result) }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `getLocation()` instead.
|
||||
*
|
||||
* Gets the source location for this element.
|
||||
*/
|
||||
deprecated Location getALocation() { result = this.getLocation() }
|
||||
|
||||
/**
|
||||
* Holds if this element is at the specified location.
|
||||
* The location spans column `startcolumn` of line `startline` to
|
||||
@@ -83,21 +76,6 @@ class XMLParent extends @xmlparent {
|
||||
/** Gets the number of places in the body of this XML parent where text occurs. */
|
||||
int getNumberOfCharacterSets() { result = count(int pos | xmlChars(_, _, this, pos, _, _)) }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Internal.
|
||||
*
|
||||
* Append the character sequences of this XML parent from left to right, separated by a space,
|
||||
* up to a specified (zero-based) index.
|
||||
*/
|
||||
deprecated string charsSetUpTo(int n) {
|
||||
n = 0 and xmlChars(_, result, this, 0, _, _)
|
||||
or
|
||||
n > 0 and
|
||||
exists(string chars | xmlChars(_, chars, this, n, _, _) |
|
||||
result = this.charsSetUpTo(n - 1) + " " + chars
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the result of appending all the character sequences of this XML parent from
|
||||
* left to right, separated by a space.
|
||||
|
||||
@@ -185,11 +185,6 @@ class AmdModuleDefinition extends CallExpr {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `AmdModuleDefinition` instead.
|
||||
*/
|
||||
deprecated class AMDModuleDefinition = AmdModuleDefinition;
|
||||
|
||||
/** An AMD dependency, considered as a path expression. */
|
||||
private class AmdDependencyPath extends PathExprCandidate {
|
||||
AmdDependencyPath() {
|
||||
@@ -327,8 +322,3 @@ class AmdModule extends Module {
|
||||
result = getDefine().getModuleExpr().flow()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `AmdModule` instead.
|
||||
*/
|
||||
deprecated class AMDModule = AmdModule;
|
||||
|
||||
@@ -13,11 +13,6 @@ class ArrayAccess = IndexExpr;
|
||||
|
||||
class AssignOp = CompoundAssignExpr;
|
||||
|
||||
/**
|
||||
* DEPRECATED: The name `BlockStmt` is now preferred in all languages.
|
||||
*/
|
||||
deprecated class Block = BlockStmt;
|
||||
|
||||
class BoolLiteral = BooleanLiteral;
|
||||
|
||||
class CaseStmt = Case;
|
||||
@@ -67,302 +62,4 @@ class ThisAccess = ThisExpr;
|
||||
class VariableAccess = VarAccess;
|
||||
|
||||
class XorBitwiseExpr = XOrExpr;
|
||||
|
||||
// Aliases for deprecated predicates from the dbscheme
|
||||
/**
|
||||
* Alias for the predicate `is_externs` defined in the .dbscheme.
|
||||
* Use `TopLevel#isExterns()` instead.
|
||||
*/
|
||||
deprecated predicate isExterns(TopLevel toplevel) { is_externs(toplevel) }
|
||||
|
||||
/**
|
||||
* Alias for the predicate `is_module` defined in the .dbscheme.
|
||||
* Use the `Module` class in `Module.qll` instead.
|
||||
*/
|
||||
deprecated predicate isModule(TopLevel toplevel) { is_module(toplevel) }
|
||||
|
||||
/**
|
||||
* Alias for the predicate `is_nodejs` defined in the .dbscheme.
|
||||
* Use `NodeModule` from `NodeJS.qll` instead.
|
||||
*/
|
||||
deprecated predicate isNodejs(TopLevel toplevel) { is_nodejs(toplevel) }
|
||||
|
||||
/**
|
||||
* Alias for the predicate `is_es2015_module` defined in the .dbscheme.
|
||||
* Use `ES2015Module` from `ES2015Modules.qll` instead.
|
||||
*/
|
||||
deprecated predicate isES2015Module(TopLevel toplevel) { is_es2015_module(toplevel) }
|
||||
|
||||
/**
|
||||
* Alias for the predicate `is_closure_module` defined in the .dbscheme.
|
||||
*/
|
||||
deprecated predicate isClosureModule(TopLevel toplevel) { is_closure_module(toplevel) }
|
||||
|
||||
/**
|
||||
* Alias for the predicate `stmt_containers` defined in the .dbscheme.
|
||||
* Use `ASTNode#getContainer()` instead.
|
||||
*/
|
||||
deprecated predicate stmtContainers(Stmt stmt, StmtContainer container) {
|
||||
stmt_containers(stmt, container)
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias for the predicate `jump_targets` defined in the .dbscheme.
|
||||
* Use `JumpStmt#getTarget()` instead.
|
||||
*/
|
||||
deprecated predicate jumpTargets(Stmt jump, Stmt target) { jump_targets(jump, target) }
|
||||
|
||||
/**
|
||||
* Alias for the predicate `is_instantiated` defined in the .dbscheme.
|
||||
* Use `NamespaceDeclaration#isInstantiated() instead.`
|
||||
*/
|
||||
deprecated predicate isInstantiated(NamespaceDeclaration decl) { is_instantiated(decl) }
|
||||
|
||||
/**
|
||||
* Alias for the predicate `has_declare_keyword` defined in the .dbscheme.
|
||||
*/
|
||||
deprecated predicate hasDeclareKeyword(ASTNode stmt) { has_declare_keyword(stmt) }
|
||||
|
||||
/**
|
||||
* Alias for the predicate `is_for_await_of` defined in the .dbscheme.
|
||||
* Use `ForOfStmt#isAwait()` instead.
|
||||
*/
|
||||
deprecated predicate isForAwaitOf(ForOfStmt forof) { is_for_await_of(forof) }
|
||||
|
||||
/**
|
||||
* Alias for the predicate `enclosing_stmt` defined in the .dbscheme.
|
||||
* Use `ExprOrType#getEnclosingStmt` instead.
|
||||
*/
|
||||
deprecated predicate enclosingStmt(ExprOrType expr, Stmt stmt) { enclosing_stmt(expr, stmt) }
|
||||
|
||||
/**
|
||||
* Alias for the predicate `expr_containers` defined in the .dbscheme.
|
||||
* Use `ASTNode#getContainer()` instead.
|
||||
*/
|
||||
deprecated predicate exprContainers(ExprOrType expr, StmtContainer container) {
|
||||
expr_containers(expr, container)
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias for the predicate `array_size` defined in the .dbscheme.
|
||||
* Use `ArrayExpr#getSize()` instead.
|
||||
*/
|
||||
deprecated predicate arraySize(Expr ae, int sz) { array_size(ae, sz) }
|
||||
|
||||
/**
|
||||
* Alias for the predicate `is_delegating` defined in the .dbscheme.
|
||||
* Use `YieldExpr#isDelegating()` instead.
|
||||
*/
|
||||
deprecated predicate isDelegating(YieldExpr yield) { is_delegating(yield) }
|
||||
|
||||
/**
|
||||
* Alias for the predicate `is_arguments_object` defined in the .dbscheme.
|
||||
* Use the `ArgumentsVariable` class instead.
|
||||
*/
|
||||
deprecated predicate isArgumentsObject(Variable id) { is_arguments_object(id) }
|
||||
|
||||
/**
|
||||
* Alias for the predicate `is_computed` defined in the .dbscheme.
|
||||
* Use the `isComputed()` method on the `MemberDeclaration`/`Property`/`PropertyPattern` class instead.
|
||||
*/
|
||||
deprecated predicate isComputed(Property prop) { is_computed(prop) }
|
||||
|
||||
/**
|
||||
* Alias for the predicate `is_method` defined in the .dbscheme.
|
||||
* Use the `isMethod()` method on the `MemberDeclaration`/`Property` class instead.
|
||||
*/
|
||||
deprecated predicate isMethod(Property prop) { is_method(prop) }
|
||||
|
||||
/**
|
||||
* Alias for the predicate `is_static` defined in the .dbscheme.
|
||||
* Use `MemberDeclaration#isStatic()` instead.
|
||||
*/
|
||||
deprecated predicate isStatic(Property prop) { is_static(prop) }
|
||||
|
||||
/**
|
||||
* Alias for the predicate `is_abstract_member` defined in the .dbscheme.
|
||||
* Use `MemberDeclaration#isAbstract()` instead.
|
||||
*/
|
||||
deprecated predicate isAbstractMember(Property prop) { is_abstract_member(prop) }
|
||||
|
||||
/**
|
||||
* Alias for the predicate `is_const_enum` defined in the .dbscheme.
|
||||
* Use `EnumDeclaration#isConst()` instead.
|
||||
*/
|
||||
deprecated predicate isConstEnum(EnumDeclaration id) { is_const_enum(id) }
|
||||
|
||||
/**
|
||||
* Alias for the predicate `is_abstract_class` defined in the .dbscheme.
|
||||
* Use `ClassDefinition#isAbstract()` instead.
|
||||
*/
|
||||
deprecated predicate isAbstractClass(ClassDeclStmt id) { is_abstract_class(id) }
|
||||
|
||||
/**
|
||||
* Alias for the predicate `has_public_keyword` defined in the .dbscheme.
|
||||
* Use `MemberDeclaration#hasPublicKeyword() instead.
|
||||
*/
|
||||
deprecated predicate hasPublicKeyword(Property prop) { has_public_keyword(prop) }
|
||||
|
||||
/**
|
||||
* Alias for the predicate `has_private_keyword` defined in the .dbscheme.
|
||||
* Use `MemberDeclaration#isPrivate() instead.
|
||||
*/
|
||||
deprecated predicate hasPrivateKeyword(Property prop) { has_private_keyword(prop) }
|
||||
|
||||
/**
|
||||
* Alias for the predicate `has_protected_keyword` defined in the .dbscheme.
|
||||
* Use `MemberDeclaration#isProtected() instead.
|
||||
*/
|
||||
deprecated predicate hasProtectedKeyword(Property prop) { has_protected_keyword(prop) }
|
||||
|
||||
/**
|
||||
* Alias for the predicate `has_readonly_keyword` defined in the .dbscheme.
|
||||
* Use `FieldDeclaration#isReadonly()` instead.
|
||||
*/
|
||||
deprecated predicate hasReadonlyKeyword(Property prop) { has_readonly_keyword(prop) }
|
||||
|
||||
/**
|
||||
* Alias for the predicate `has_type_keyword` defined in the .dbscheme.
|
||||
* Use the `isTypeOnly` method on the `ImportDeclaration`/`ExportDeclaration` classes instead.
|
||||
*/
|
||||
deprecated predicate hasTypeKeyword(ASTNode id) { has_type_keyword(id) }
|
||||
|
||||
/**
|
||||
* Alias for the predicate `is_optional_member` defined in the .dbscheme.
|
||||
* Use `FieldDeclaration#isOptional()` instead.
|
||||
*/
|
||||
deprecated predicate isOptionalMember(Property id) { is_optional_member(id) }
|
||||
|
||||
/**
|
||||
* Alias for the predicate `has_definite_assignment_assertion` defined in the .dbscheme.
|
||||
* Use the `hasDefiniteAssignmentAssertion` method on the `FieldDeclaration`/`VariableDeclarator` classes instead.
|
||||
*/
|
||||
deprecated predicate hasDefiniteAssignmentAssertion(ASTNode id) {
|
||||
has_definite_assignment_assertion(id)
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias for the predicate `is_optional_parameter_declaration` defined in the .dbscheme.
|
||||
* Use `Parameter#isDeclaredOptional()` instead.
|
||||
*/
|
||||
deprecated predicate isOptionalParameterDeclaration(Parameter parameter) {
|
||||
is_optional_parameter_declaration(parameter)
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias for the predicate `has_asserts_keyword` defined in the .dbscheme.
|
||||
* Use `PredicateTypeExpr#hasAssertsKeyword() instead.
|
||||
*/
|
||||
deprecated predicate hasAssertsKeyword(PredicateTypeExpr node) { has_asserts_keyword(node) }
|
||||
|
||||
/**
|
||||
* Alias for the predicate `js_parse_errors` defined in the .dbscheme.
|
||||
* Use the `JSParseError` class instead.
|
||||
*/
|
||||
deprecated predicate jsParseErrors(JSParseError id, TopLevel toplevel, string message, string line) {
|
||||
js_parse_errors(id, toplevel, message, line)
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias for the predicate `regexp_parse_errors` defined in the .dbscheme.
|
||||
* Use the `RegExpParseError` class instead.
|
||||
*/
|
||||
deprecated predicate regexpParseErrors(RegExpParseError id, RegExpTerm regexp, string message) {
|
||||
regexp_parse_errors(id, regexp, message)
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias for the predicate `is_greedy` defined in the .dbscheme.
|
||||
* Use `RegExpQuantifier#isGreedy` instead.
|
||||
*/
|
||||
deprecated predicate isGreedy(RegExpQuantifier id) { is_greedy(id) }
|
||||
|
||||
/**
|
||||
* Alias for the predicate `range_quantifier_lower_bound` defined in the .dbscheme.
|
||||
* Use `RegExpRange#getLowerBound()` instead.
|
||||
*/
|
||||
deprecated predicate rangeQuantifierLowerBound(RegExpRange id, int lo) {
|
||||
range_quantifier_lower_bound(id, lo)
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias for the predicate `range_quantifier_upper_bound` defined in the .dbscheme.
|
||||
* Use `RegExpRange#getUpperBound() instead.
|
||||
*/
|
||||
deprecated predicate rangeQuantifierUpperBound(RegExpRange id, int hi) {
|
||||
range_quantifier_upper_bound(id, hi)
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias for the predicate `is_capture` defined in the .dbscheme.
|
||||
* Use `RegExpGroup#isCapture()` instead.
|
||||
*/
|
||||
deprecated predicate isCapture(RegExpGroup id, int number) { is_capture(id, number) }
|
||||
|
||||
/**
|
||||
* Alias for the predicate `is_named_capture` defined in the .dbscheme.
|
||||
* Use `RegExpGroup#isNamed()` instead.
|
||||
*/
|
||||
deprecated predicate isNamedCapture(RegExpGroup id, string name) { is_named_capture(id, name) }
|
||||
|
||||
/**
|
||||
* Alias for the predicate `is_inverted` defined in the .dbscheme.
|
||||
* Use `RegExpCharacterClass#isInverted()` instead.
|
||||
*/
|
||||
deprecated predicate isInverted(RegExpCharacterClass id) { is_inverted(id) }
|
||||
|
||||
/**
|
||||
* Alias for the predicate `regexp_const_value` defined in the .dbscheme.
|
||||
* Use `RegExpConstant#getValue()` instead.
|
||||
*/
|
||||
deprecated predicate regexpConstValue(RegExpConstant id, string value) {
|
||||
regexp_const_value(id, value)
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias for the predicate `char_class_escape` defined in the .dbscheme.
|
||||
* Use `RegExpCharacterClassEscape#getValue()` instead.
|
||||
*/
|
||||
deprecated predicate charClassEscape(RegExpCharacterClassEscape id, string value) {
|
||||
char_class_escape(id, value)
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias for the predicate `named_backref` defined in the .dbscheme.
|
||||
* Use `RegExpBackRef#getName()` instead.
|
||||
*/
|
||||
deprecated predicate namedBackref(RegExpBackRef id, string name) { named_backref(id, name) }
|
||||
|
||||
/**
|
||||
* Alias for the predicate `unicode_property_escapename` defined in the .dbscheme.
|
||||
* Use `RegExpUnicodePropertyEscape#getName()` instead.
|
||||
*/
|
||||
deprecated predicate unicodePropertyEscapeName(RegExpUnicodePropertyEscape id, string name) {
|
||||
unicode_property_escapename(id, name)
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias for the predicate `unicode_property_escapevalue` defined in the .dbscheme.
|
||||
* Use `RegExpUnicodePropertyEscape#getValue()` instead.
|
||||
*/
|
||||
deprecated predicate unicodePropertyEscapeValue(RegExpUnicodePropertyEscape id, string value) {
|
||||
unicode_property_escapevalue(id, value)
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias for the predicate `is_generator` defined in the .dbscheme.
|
||||
* Use `Function#isGenerator()` instead.
|
||||
*/
|
||||
deprecated predicate isGenerator(Function fun) { is_generator(fun) }
|
||||
|
||||
/**
|
||||
* Alias for the predicate `has_rest_parameter` defined in the .dbscheme.
|
||||
* Use `Function#hasRestParameter()` instead.
|
||||
*/
|
||||
deprecated predicate hasRestParameter(Function fun) { has_rest_parameter(fun) }
|
||||
|
||||
/**
|
||||
* Alias for the predicate `is_async` defined in the .dbscheme.
|
||||
* Use `Function#isAsync()` instead.
|
||||
*/
|
||||
deprecated predicate isAsync(Function fun) { is_async(fun) }
|
||||
|
||||
@@ -647,13 +647,6 @@ abstract class ReExportDeclaration extends ExportDeclaration {
|
||||
/** Gets the path of the module from which this declaration re-exports. */
|
||||
abstract ConstantString getImportedPath();
|
||||
|
||||
/**
|
||||
* DEPRECATED. Use `getReExportedES2015Module()` instead.
|
||||
*
|
||||
* Gets the module from which this declaration re-exports.
|
||||
*/
|
||||
deprecated ES2015Module getImportedModule() { result = getReExportedModule() }
|
||||
|
||||
/** Gets the module from which this declaration re-exports, if it is an ES2015 module. */
|
||||
ES2015Module getReExportedES2015Module() { result = getReExportedModule() }
|
||||
|
||||
|
||||
@@ -7,31 +7,6 @@ private import semmle.javascript.dataflow.InferredTypes
|
||||
private import semmle.javascript.dataflow.internal.FlowSteps as FlowSteps
|
||||
private import semmle.javascript.internal.CachedStages
|
||||
|
||||
deprecated module GlobalAccessPath {
|
||||
/**
|
||||
* DEPRECATED. Instead use `AccessPath::getAReferenceTo` with the result and parameter reversed.
|
||||
*/
|
||||
pragma[inline]
|
||||
string fromReference(DataFlow::Node node) { node = AccessPath::getAReferenceTo(result) }
|
||||
|
||||
/**
|
||||
* DEPRECATED. Instead use `AccessPath::getAnAssignmentTo` with the result and parameter reversed.
|
||||
*/
|
||||
pragma[inline]
|
||||
string fromRhs(DataFlow::Node node) { node = AccessPath::getAnAssignmentTo(result) }
|
||||
|
||||
/**
|
||||
* DEPRECATED. Use `AccessPath::getAReferenceOrAssignmentTo`.
|
||||
*/
|
||||
pragma[inline]
|
||||
string getAccessPath(DataFlow::Node node) {
|
||||
result = fromReference(node)
|
||||
or
|
||||
not exists(fromReference(node)) and
|
||||
result = fromRhs(node)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides predicates for associating access paths with data flow nodes.
|
||||
*
|
||||
|
||||
@@ -27,76 +27,6 @@ abstract class Module extends TopLevel {
|
||||
/** Gets a symbol exported by this module. */
|
||||
string getAnExportedSymbol() { exists(this.getAnExportedValue(result)) }
|
||||
|
||||
/**
|
||||
* DEPRECATED. Use `getAnExportedValue` instead.
|
||||
*
|
||||
* Holds if this module explicitly exports symbol `name` at the
|
||||
* program element `export`.
|
||||
*
|
||||
* Note that in some module systems (notably CommonJS and AMD)
|
||||
* modules are arbitrary objects that export all their
|
||||
* properties. This predicate only considers properties
|
||||
* that are explicitly defined on the module object.
|
||||
*
|
||||
* Symbols defined in another module that are re-exported by
|
||||
* this module are only sometimes considered.
|
||||
*/
|
||||
deprecated predicate exports(string name, ASTNode export) {
|
||||
this instanceof AmdModule and
|
||||
exists(DataFlow::PropWrite pwn | export = pwn.getAstNode() |
|
||||
pwn.getBase().analyze().getAValue() = this.(AmdModule).getDefine().getAModuleExportsValue() and
|
||||
name = pwn.getPropertyName()
|
||||
)
|
||||
or
|
||||
this instanceof Closure::ClosureModule and
|
||||
exists(DataFlow::PropWrite write, Expr base |
|
||||
write.getAstNode() = export and
|
||||
write.writes(base.flow(), name, _) and
|
||||
(
|
||||
base = this.(Closure::ClosureModule).getExportsVariable().getAReference()
|
||||
or
|
||||
base = this.(Closure::ClosureModule).getExportsVariable().getAnAssignedExpr()
|
||||
)
|
||||
)
|
||||
or
|
||||
this instanceof NodeModule and
|
||||
(
|
||||
// a property write whose base is `exports` or `module.exports`
|
||||
exists(DataFlow::PropWrite pwn | export = pwn.getAstNode() |
|
||||
pwn.getBase() = this.(NodeModule).getAModuleExportsNode() and
|
||||
name = pwn.getPropertyName()
|
||||
)
|
||||
or
|
||||
// a re-export using spread-operator. E.g. `const foo = require("./foo"); module.exports = {bar: bar, ...foo};`
|
||||
exists(ObjectExpr obj | obj = this.(NodeModule).getAModuleExportsNode().asExpr() |
|
||||
obj.getAProperty()
|
||||
.(SpreadProperty)
|
||||
.getInit()
|
||||
.(SpreadElement)
|
||||
.getOperand()
|
||||
.flow()
|
||||
.getALocalSource()
|
||||
.asExpr()
|
||||
.(Import)
|
||||
.getImportedModule()
|
||||
.exports(name, export)
|
||||
)
|
||||
or
|
||||
// an externs definition (where appropriate)
|
||||
exists(PropAccess pacc | export = pacc |
|
||||
pacc.getBase() = this.(NodeModule).getAModuleExportsNode().asExpr() and
|
||||
name = pacc.getPropertyName() and
|
||||
this.isExterns() and
|
||||
exists(pacc.getDocumentation())
|
||||
)
|
||||
)
|
||||
or
|
||||
this instanceof ES2015Module and
|
||||
exists(ExportDeclaration ed | ed = this.(ES2015Module).getAnExport() and ed = export |
|
||||
ed.exportsAs(_, name)
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a value that is explicitly exported from this module with under `name`.
|
||||
*
|
||||
@@ -275,19 +205,6 @@ abstract class Import extends ASTNode {
|
||||
abstract DataFlow::Node getImportedModuleNode();
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED. Use `PathExpr` instead.
|
||||
*
|
||||
* A path expression that appears in a module and is resolved relative to it.
|
||||
*/
|
||||
abstract deprecated class PathExprInModule extends PathExpr {
|
||||
PathExprInModule() {
|
||||
this.(Expr).getTopLevel() instanceof Module
|
||||
or
|
||||
this.(Comment).getTopLevel() instanceof Module
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a module imported from another package in the same repository.
|
||||
*
|
||||
|
||||
@@ -434,11 +434,6 @@ module PromiseFlow {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED. Use `TaintTracking::promiseStep` instead.
|
||||
*/
|
||||
deprecated predicate promiseTaintStep = TaintTracking::promiseStep/2;
|
||||
|
||||
private class PromiseTaintStep extends TaintTracking::SharedTaintStep {
|
||||
override predicate promiseStep(DataFlow::Node pred, DataFlow::Node succ) {
|
||||
// from `x` to `new Promise((res, rej) => res(x))`
|
||||
|
||||
@@ -663,15 +663,6 @@ class RegExpNormalConstant extends RegExpConstant, @regexp_normal_constant {
|
||||
override string getAPrimaryQlClass() { result = "RegExpNormalConstant" }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED. Use `RegExpNormalConstant` instead.
|
||||
*
|
||||
* This class used to represent an individual normal character but has been superseded by
|
||||
* `RegExpNormalConstant`, which represents a sequence of normal characters.
|
||||
* There is no longer a separate node for each individual character in a constant.
|
||||
*/
|
||||
deprecated class RegExpNormalChar = RegExpNormalConstant;
|
||||
|
||||
/**
|
||||
* A hexadecimal character escape in a regular expression.
|
||||
*
|
||||
|
||||
@@ -1754,20 +1754,6 @@ class ReferenceImport extends LineComment {
|
||||
* Gets the name of the attribute, i.e. "`path`" or "`types`".
|
||||
*/
|
||||
string getAttributeName() { result = attribute }
|
||||
|
||||
/**
|
||||
* DEPRECATED. This is no longer supported.
|
||||
*
|
||||
* Gets the file referenced by this import.
|
||||
*/
|
||||
deprecated File getImportedFile() { none() }
|
||||
|
||||
/**
|
||||
* DEPRECATED. This is no longer supported.
|
||||
*
|
||||
* Gets the top-level of the referenced file.
|
||||
*/
|
||||
deprecated TopLevel getImportedTopLevel() { none() }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1853,11 +1839,6 @@ class Type extends @type {
|
||||
*/
|
||||
Type getChild(int i) { type_child(result, this, i) }
|
||||
|
||||
/**
|
||||
* DEPRECATED. Property lookup on types is no longer supported.
|
||||
*/
|
||||
deprecated Type getProperty(string name) { none() }
|
||||
|
||||
/**
|
||||
* Gets the type of the string index signature on this type,
|
||||
* such as `T` in the type `{ [s: string]: T }`.
|
||||
@@ -1960,21 +1941,6 @@ class Type extends @type {
|
||||
*/
|
||||
int getNumConstructorSignature() { result = count(this.getAConstructorSignature()) }
|
||||
|
||||
/**
|
||||
* DEPRECATED. Method lookup on types is no longer supported.
|
||||
*/
|
||||
deprecated FunctionCallSignatureType getMethod(string name) { none() }
|
||||
|
||||
/**
|
||||
* DEPRECATED. Method lookup on types is no longer supported.
|
||||
*/
|
||||
deprecated FunctionCallSignatureType getMethodOverload(string name, int n) { none() }
|
||||
|
||||
/**
|
||||
* DEPRECATED. Method lookup on types is no longer supported.
|
||||
*/
|
||||
deprecated FunctionCallSignatureType getAMethodOverload(string name) { none() }
|
||||
|
||||
/**
|
||||
* Repeatedly unfolds union and intersection types and gets any of the underlying types,
|
||||
* or this type itself if it is not a union or intersection.
|
||||
|
||||
@@ -12,13 +12,6 @@ class XMLLocatable extends @xmllocatable, TXMLLocatable {
|
||||
/** Gets the source location for this element. */
|
||||
Location getLocation() { xmllocations(this, result) }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `getLocation()` instead.
|
||||
*
|
||||
* Gets the source location for this element.
|
||||
*/
|
||||
deprecated Location getALocation() { result = this.getLocation() }
|
||||
|
||||
/**
|
||||
* Holds if this element is at the specified location.
|
||||
* The location spans column `startcolumn` of line `startline` to
|
||||
@@ -83,21 +76,6 @@ class XMLParent extends @xmlparent {
|
||||
/** Gets the number of places in the body of this XML parent where text occurs. */
|
||||
int getNumberOfCharacterSets() { result = count(int pos | xmlChars(_, _, this, pos, _, _)) }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Internal.
|
||||
*
|
||||
* Append the character sequences of this XML parent from left to right, separated by a space,
|
||||
* up to a specified (zero-based) index.
|
||||
*/
|
||||
deprecated string charsSetUpTo(int n) {
|
||||
n = 0 and xmlChars(_, result, this, 0, _, _)
|
||||
or
|
||||
n > 0 and
|
||||
exists(string chars | xmlChars(_, chars, this, n, _, _) |
|
||||
result = this.charsSetUpTo(n - 1) + " " + chars
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the result of appending all the character sequences of this XML parent from
|
||||
* left to right, separated by a space.
|
||||
|
||||
@@ -166,20 +166,6 @@ abstract class Configuration extends string {
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `isBarrierEdge` instead.
|
||||
*
|
||||
* Holds if flow from `src` to `trg` is prohibited.
|
||||
*/
|
||||
deprecated predicate isBarrier(DataFlow::Node src, DataFlow::Node trg) { none() }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `isBarrierEdge` instead.
|
||||
*
|
||||
* Holds if flow with label `lbl` cannot flow from `src` to `trg`.
|
||||
*/
|
||||
deprecated predicate isBarrier(DataFlow::Node src, DataFlow::Node trg, FlowLabel lbl) { none() }
|
||||
|
||||
/**
|
||||
* Holds if flow from `pred` to `succ` is prohibited.
|
||||
*/
|
||||
@@ -535,13 +521,6 @@ private predicate isLabeledBarrierEdge(
|
||||
*/
|
||||
abstract class LabeledBarrierGuardNode extends BarrierGuardNode {
|
||||
override predicate blocks(boolean outcome, Expr e) { none() }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `blocks(outcome, e, label)` or `sanitizes(outcome, e, label)` instead.
|
||||
*
|
||||
* Overriding this predicate has no effect.
|
||||
*/
|
||||
deprecated FlowLabel getALabel() { none() }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1403,13 +1403,6 @@ module PartialInvokeNode {
|
||||
*/
|
||||
DataFlow::SourceNode getBoundFunction(DataFlow::Node callback, int boundArgs) { none() }
|
||||
|
||||
/**
|
||||
* DEPRECATED. Use the one-argument version of `getBoundReceiver` instead.
|
||||
*
|
||||
* Gets the node holding the receiver to be passed to the bound function, if specified.
|
||||
*/
|
||||
deprecated DataFlow::Node getBoundReceiver() { none() }
|
||||
|
||||
/**
|
||||
* Gets the node holding the receiver to be passed to `callback`.
|
||||
*/
|
||||
@@ -1541,16 +1534,6 @@ module PartialInvokeNode {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED. Subclasses should extend `PartialInvokeNode::Range` instead,
|
||||
* and predicates should use `PartialInvokeNode` instead.
|
||||
*
|
||||
* An invocation that is modeled as a partial function application.
|
||||
*
|
||||
* This contributes additional argument-passing flow edges that should be added to all data flow configurations.
|
||||
*/
|
||||
deprecated class AdditionalPartialInvokeNode = PartialInvokeNode::Range;
|
||||
|
||||
/**
|
||||
* An invocation of the `RegExp` constructor.
|
||||
*
|
||||
|
||||
@@ -395,7 +395,3 @@ SourceNode moduleVarNode(Module m) { result.(ModuleVarNode).getModule() = m }
|
||||
|
||||
/** Gets the CommonJS/AMD `exports` variable for module `m`. */
|
||||
SourceNode exportsVarNode(Module m) { result.(ExportsVarNode).getModule() = m }
|
||||
|
||||
deprecated class DefaultSourceNode extends SourceNode {
|
||||
DefaultSourceNode() { this instanceof SourceNode::DefaultRange }
|
||||
}
|
||||
|
||||
@@ -62,24 +62,6 @@ module TaintTracking {
|
||||
*/
|
||||
predicate isSanitizer(DataFlow::Node node) { none() }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `isSanitizerEdge` instead.
|
||||
*
|
||||
* Holds if the edge from `source` to `sink` is a taint sanitizer.
|
||||
*/
|
||||
deprecated predicate isSanitizer(DataFlow::Node source, DataFlow::Node sink) { none() }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `isSanitizerEdge` instead.
|
||||
*
|
||||
* Holds if the edge from `source` to `sink` is a taint sanitizer for data labelled with `lbl`.
|
||||
*/
|
||||
deprecated predicate isSanitizer(
|
||||
DataFlow::Node source, DataFlow::Node sink, DataFlow::FlowLabel lbl
|
||||
) {
|
||||
none()
|
||||
}
|
||||
|
||||
/** Holds if the edge from `pred` to `succ` is a taint sanitizer. */
|
||||
predicate isSanitizerEdge(DataFlow::Node pred, DataFlow::Node succ) { none() }
|
||||
|
||||
@@ -569,22 +551,6 @@ module TaintTracking {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED. Use the predicate `TaintTracking::persistentStorageStep` instead.
|
||||
*
|
||||
* A taint propagating data flow edge through persistent storage.
|
||||
*/
|
||||
deprecated class PersistentStorageTaintStep extends SharedTaintStep {
|
||||
override predicate persistentStorageStep(DataFlow::Node pred, DataFlow::Node succ) {
|
||||
exists(PersistentReadAccess read |
|
||||
pred = read.getAWrite().getValue() and
|
||||
succ = read
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
deprecated predicate arrayFunctionTaintStep = ArrayTaintTracking::arrayFunctionTaintStep/3;
|
||||
|
||||
/**
|
||||
* A taint propagating data flow edge for assignments of the form `o[k] = v`, where
|
||||
* one of the following holds:
|
||||
@@ -1175,9 +1141,6 @@ module TaintTracking {
|
||||
polarity = guard.asExpr().(EqualityTest).getPolarity()
|
||||
}
|
||||
|
||||
/** DEPRECATED. This class has been renamed to `MembershipTestSanitizer`. */
|
||||
deprecated class StringInclusionSanitizer = MembershipTestSanitizer;
|
||||
|
||||
/**
|
||||
* A test of form `x.length === "0"`, preventing `x` from being tainted.
|
||||
*/
|
||||
@@ -1200,9 +1163,6 @@ module TaintTracking {
|
||||
override predicate appliesTo(Configuration cfg) { any() }
|
||||
}
|
||||
|
||||
/** DEPRECATED. This class has been renamed to `MembershipTestSanitizer`. */
|
||||
deprecated class InclusionSanitizer = MembershipTestSanitizer;
|
||||
|
||||
/**
|
||||
* A check of the form `whitelist.includes(x)` or equivalent, which sanitizes `x` in its "then" branch.
|
||||
*/
|
||||
@@ -1247,35 +1207,6 @@ module TaintTracking {
|
||||
/** Gets a variable that is defined exactly once. */
|
||||
private Variable singleDef() { strictcount(result.getADefinition()) = 1 }
|
||||
|
||||
/**
|
||||
* A check of the form `if(x == 'some-constant')`, which sanitizes `x` in its "then" branch.
|
||||
*
|
||||
* DEPRECATED: use `MembershipTestSanitizer` instead.
|
||||
*/
|
||||
deprecated class ConstantComparison extends SanitizerGuardNode, DataFlow::ValueNode {
|
||||
Expr x;
|
||||
override EqualityTest astNode;
|
||||
|
||||
ConstantComparison() {
|
||||
exists(Expr const | astNode.hasOperands(x, const) |
|
||||
// either the other operand is a constant
|
||||
const instanceof ConstantExpr
|
||||
or
|
||||
// or it's an access to a variable that probably acts as a symbolic constant
|
||||
const = singleDef().getAnAccess()
|
||||
)
|
||||
}
|
||||
|
||||
override predicate sanitizes(boolean outcome, Expr e) {
|
||||
outcome = astNode.getPolarity() and x = e
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if this guard applies to the flow in `cfg`.
|
||||
*/
|
||||
predicate appliesTo(Configuration cfg) { any() }
|
||||
}
|
||||
|
||||
/**
|
||||
* An equality test on `e.origin` or `e.source` where `e` is a `postMessage` event object,
|
||||
* considered as a sanitizer for `e`.
|
||||
|
||||
@@ -54,39 +54,6 @@
|
||||
private import javascript
|
||||
private import internal.FlowSteps as FlowSteps
|
||||
|
||||
/**
|
||||
* A data flow node that should be tracked inter-procedurally.
|
||||
*
|
||||
* To track additional values, extends this class with additional
|
||||
* subclasses.
|
||||
*/
|
||||
abstract deprecated class TrackedNode extends DataFlow::Node {
|
||||
/**
|
||||
* Holds if this node flows into `sink` in zero or more (possibly
|
||||
* inter-procedural) steps.
|
||||
*/
|
||||
predicate flowsTo(DataFlow::Node sink) { NodeTracking::flowsTo(this, sink, _) }
|
||||
}
|
||||
|
||||
/**
|
||||
* An expression whose value should be tracked inter-procedurally.
|
||||
*
|
||||
* To track additional expressions, extends this class with additional
|
||||
* subclasses.
|
||||
*/
|
||||
abstract deprecated class TrackedExpr extends Expr {
|
||||
predicate flowsTo(Expr sink) {
|
||||
exists(TrackedExprNode ten | ten.asExpr() = this | ten.flowsTo(DataFlow::valueNode(sink)))
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Turn all `TrackedExpr`s into `TrackedNode`s.
|
||||
*/
|
||||
deprecated private class TrackedExprNode extends TrackedNode {
|
||||
TrackedExprNode() { asExpr() instanceof TrackedExpr }
|
||||
}
|
||||
|
||||
/**
|
||||
* A simplified copy of `Configuration.qll` that implements tracking
|
||||
* of `TrackedNode`s without barriers or additional flow steps.
|
||||
@@ -106,320 +73,4 @@ private module NodeTracking {
|
||||
or
|
||||
localExceptionStep(pred, succ)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if there is a flow step from `pred` to `succ` described by `summary`.
|
||||
*
|
||||
* Summary steps through function calls are not taken into account.
|
||||
*/
|
||||
deprecated private predicate basicFlowStep(
|
||||
DataFlow::Node pred, DataFlow::Node succ, PathSummary summary
|
||||
) {
|
||||
isRelevant(pred) and
|
||||
(
|
||||
// Local flow
|
||||
localFlowStep(pred, succ) and
|
||||
summary = PathSummary::level()
|
||||
or
|
||||
// Flow through properties of objects
|
||||
propertyFlowStep(pred, succ) and
|
||||
summary = PathSummary::level()
|
||||
or
|
||||
// Flow through global variables
|
||||
globalFlowStep(pred, succ) and
|
||||
summary = PathSummary::level()
|
||||
or
|
||||
// Flow into function
|
||||
callStep(pred, succ) and
|
||||
summary = PathSummary::call()
|
||||
or
|
||||
// Flow out of function
|
||||
returnStep(pred, succ) and
|
||||
summary = PathSummary::return()
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `nd` may be reachable from a tracked node.
|
||||
*
|
||||
* No call/return matching is done, so this is a relatively coarse over-approximation.
|
||||
*/
|
||||
deprecated private predicate isRelevant(DataFlow::Node nd) {
|
||||
nd instanceof TrackedNode
|
||||
or
|
||||
exists(DataFlow::Node mid | isRelevant(mid) |
|
||||
basicFlowStep(mid, nd, _)
|
||||
or
|
||||
basicStoreStep(mid, nd, _)
|
||||
or
|
||||
basicLoadStep(mid, nd, _)
|
||||
or
|
||||
exploratoryCallbackStep(mid, nd)
|
||||
or
|
||||
nd = mid.(DataFlow::FunctionNode).getAParameter()
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `pred` is an input to `f` which is passed to `succ` at `invk`; that is,
|
||||
* either `pred` is an argument of `f` and `succ` the corresponding parameter, or
|
||||
* `pred` is a variable definition whose value is captured by `f` at `succ`.
|
||||
*/
|
||||
deprecated private predicate callInputStep(
|
||||
Function f, DataFlow::Node invk, DataFlow::Node pred, DataFlow::Node succ
|
||||
) {
|
||||
isRelevant(pred) and
|
||||
(
|
||||
argumentPassing(invk, pred, f, succ)
|
||||
or
|
||||
exists(LocalVariable variable, SsaDefinition def |
|
||||
pred = DataFlow::capturedVariableNode(variable) and
|
||||
calls(invk, f) and
|
||||
captures(f, variable, def) and
|
||||
succ = DataFlow::ssaDefinitionNode(def)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `input`, which is either an argument to `f` at `invk` or a definition
|
||||
* that is captured by `f`, may flow to `nd` (possibly through callees, but not containing
|
||||
* any unmatched calls or returns) along a path summarized by `summary`.
|
||||
*/
|
||||
deprecated private predicate reachableFromInput(
|
||||
Function f, DataFlow::Node invk, DataFlow::Node input, DataFlow::Node nd, PathSummary summary
|
||||
) {
|
||||
callInputStep(f, invk, input, nd) and
|
||||
summary = PathSummary::level()
|
||||
or
|
||||
exists(DataFlow::Node mid, PathSummary oldSummary, PathSummary newSummary |
|
||||
reachableFromInput(f, invk, input, mid, oldSummary) and
|
||||
flowStep(mid, nd, newSummary) and
|
||||
newSummary.isLevel() and
|
||||
summary = oldSummary.append(newSummary)
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `nd` may flow into a return statement of `f`
|
||||
* (possibly through callees) along a path summarized by `summary`.
|
||||
*/
|
||||
deprecated private predicate reachesReturn(Function f, DataFlow::Node nd, PathSummary summary) {
|
||||
returnExpr(f, nd, _) and
|
||||
summary = PathSummary::level()
|
||||
or
|
||||
exists(DataFlow::Node mid, PathSummary oldSummary, PathSummary newSummary |
|
||||
flowStep(nd, mid, oldSummary) and
|
||||
reachesReturn(f, mid, newSummary) and
|
||||
summary = oldSummary.append(newSummary)
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if a function invoked at `invk` may return an expression into which `input`,
|
||||
* which is either an argument or a definition captured by the function, flows,
|
||||
* possibly through callees.
|
||||
*/
|
||||
deprecated private predicate flowThroughCall(DataFlow::Node input, DataFlow::Node output) {
|
||||
exists(Function f, DataFlow::ValueNode ret |
|
||||
ret.asExpr() = f.getAReturnedExpr() and
|
||||
reachableFromInput(f, output, input, ret, _)
|
||||
)
|
||||
or
|
||||
exists(Function f, DataFlow::Node invk, DataFlow::Node ret |
|
||||
DataFlow::exceptionalFunctionReturnNode(ret, f) and
|
||||
DataFlow::exceptionalInvocationReturnNode(output, invk.asExpr()) and
|
||||
calls(invk, f) and
|
||||
reachableFromInput(f, invk, input, ret, _)
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `pred` may flow into property `prop` of `succ` along a path summarized by `summary`.
|
||||
*/
|
||||
deprecated private predicate storeStep(
|
||||
DataFlow::Node pred, DataFlow::SourceNode succ, string prop, PathSummary summary
|
||||
) {
|
||||
basicStoreStep(pred, succ, prop) and
|
||||
summary = PathSummary::level()
|
||||
or
|
||||
exists(Function f, DataFlow::Node mid | not f.isAsyncOrGenerator() |
|
||||
// `f` stores its parameter `pred` in property `prop` of a value that flows back to the caller,
|
||||
// and `succ` is an invocation of `f`
|
||||
reachableFromInput(f, succ, pred, mid, summary) and
|
||||
(
|
||||
returnedPropWrite(f, _, prop, mid)
|
||||
or
|
||||
succ instanceof DataFlow::NewNode and
|
||||
receiverPropWrite(f, prop, mid)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if property `prop` of `pred` may flow into `succ` along a path summarized by
|
||||
* `summary`.
|
||||
*/
|
||||
deprecated private predicate loadStep(
|
||||
DataFlow::Node pred, DataFlow::Node succ, string prop, PathSummary summary
|
||||
) {
|
||||
basicLoadStep(pred, succ, prop) and
|
||||
summary = PathSummary::level()
|
||||
or
|
||||
exists(Function f, DataFlow::SourceNode parm | not f.isAsyncOrGenerator() |
|
||||
argumentPassing(succ, pred, f, parm) and
|
||||
reachesReturn(f, parm.getAPropertyRead(prop), summary)
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `rhs` is the right-hand side of a write to property `prop`, and `nd` is reachable
|
||||
* from the base of that write (possibly through callees) along a path summarized by `summary`.
|
||||
*/
|
||||
deprecated private predicate reachableFromStoreBase(
|
||||
string prop, DataFlow::Node rhs, DataFlow::Node nd, PathSummary summary
|
||||
) {
|
||||
storeStep(rhs, nd, prop, summary)
|
||||
or
|
||||
exists(DataFlow::Node mid, PathSummary oldSummary, PathSummary newSummary |
|
||||
reachableFromStoreBase(prop, rhs, mid, oldSummary) and
|
||||
flowStep(mid, nd, newSummary) and
|
||||
summary = oldSummary.append(newSummary)
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if the value of `pred` is written to a property of some base object, and that base
|
||||
* object may flow into the base of property read `succ` along a path summarized by `summary`.
|
||||
*
|
||||
* In other words, `pred` may flow to `succ` through a property.
|
||||
*/
|
||||
deprecated private predicate flowThroughProperty(
|
||||
DataFlow::Node pred, DataFlow::Node succ, PathSummary summary
|
||||
) {
|
||||
exists(string prop, DataFlow::Node base, PathSummary oldSummary, PathSummary newSummary |
|
||||
reachableFromStoreBase(prop, pred, base, oldSummary) and
|
||||
loadStep(base, succ, prop, newSummary) and
|
||||
summary = oldSummary.append(newSummary)
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `arg` and `cb` are passed as arguments to a function which in turn
|
||||
* invokes `cb`, passing `arg` as its `i`th argument. `arg` flows along a path summarized
|
||||
* by `summary`, while `cb` is only tracked locally.
|
||||
*/
|
||||
deprecated private predicate summarizedHigherOrderCall(
|
||||
DataFlow::Node arg, DataFlow::Node cb, int i, PathSummary summary
|
||||
) {
|
||||
exists(
|
||||
Function f, DataFlow::InvokeNode outer, DataFlow::InvokeNode inner, int j,
|
||||
DataFlow::Node innerArg, DataFlow::SourceNode cbParm, PathSummary oldSummary
|
||||
|
|
||||
reachableFromInput(f, outer, arg, innerArg, oldSummary) and
|
||||
argumentPassing(outer, cb, f, cbParm) and
|
||||
innerArg = inner.getArgument(j)
|
||||
|
|
||||
// direct higher-order call
|
||||
cbParm.flowsTo(inner.getCalleeNode()) and
|
||||
i = j and
|
||||
summary = oldSummary
|
||||
or
|
||||
// indirect higher-order call
|
||||
exists(DataFlow::Node cbArg, PathSummary newSummary |
|
||||
cbParm.flowsTo(cbArg) and
|
||||
summarizedHigherOrderCall(innerArg, cbArg, i, newSummary) and
|
||||
summary = oldSummary.append(PathSummary::call()).append(newSummary)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `arg` is passed as the `i`th argument to `callback` through a callback invocation.
|
||||
*
|
||||
* This can be a summarized call, that is, `arg` and `callback` flow into a call,
|
||||
* `f(arg, callback)`, which performs the invocation.
|
||||
*
|
||||
* Alternatively, the callback can flow into a call `f(callback)` which itself provides the `arg`.
|
||||
* That is, `arg` refers to a value defined in `f` or one of its callees.
|
||||
*/
|
||||
deprecated predicate higherOrderCall(
|
||||
DataFlow::Node arg, DataFlow::SourceNode callback, int i, PathSummary summary
|
||||
) {
|
||||
// Summarized call
|
||||
exists(DataFlow::Node cb |
|
||||
summarizedHigherOrderCall(arg, cb, i, summary) and
|
||||
callback.flowsTo(cb)
|
||||
)
|
||||
or
|
||||
// Local invocation of a parameter
|
||||
isRelevant(arg) and
|
||||
exists(DataFlow::InvokeNode invoke |
|
||||
arg = invoke.getArgument(i) and
|
||||
invoke = callback.(DataFlow::ParameterNode).getACall() and
|
||||
summary = PathSummary::call()
|
||||
)
|
||||
or
|
||||
// Forwarding of the callback parameter (but not the argument).
|
||||
// We use a return summary since flow moves back towards the call site.
|
||||
// This ensures that an argument that is only tainted in some contexts cannot flow
|
||||
// out to every callback.
|
||||
exists(DataFlow::Node cbArg, DataFlow::SourceNode innerCb, PathSummary oldSummary |
|
||||
higherOrderCall(arg, innerCb, i, oldSummary) and
|
||||
callStep(cbArg, innerCb) and
|
||||
callback.flowsTo(cbArg) and
|
||||
summary = PathSummary::return().append(oldSummary)
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `pred` is passed as an argument to a function `f` which also takes a
|
||||
* callback parameter `cb` and then invokes `cb`, passing `pred` into parameter `succ`
|
||||
* of `cb`. `arg` flows along a path summarized by `summary`, while `cb` is only tracked
|
||||
* locally.
|
||||
*/
|
||||
deprecated private predicate flowIntoHigherOrderCall(
|
||||
DataFlow::Node pred, DataFlow::Node succ, PathSummary summary
|
||||
) {
|
||||
exists(DataFlow::FunctionNode cb, int i, PathSummary oldSummary |
|
||||
higherOrderCall(pred, cb, i, oldSummary) and
|
||||
succ = cb.getParameter(i) and
|
||||
summary = oldSummary.append(PathSummary::call())
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if there is a flow step from `pred` to `succ` described by `summary`.
|
||||
*/
|
||||
deprecated private predicate flowStep(
|
||||
DataFlow::Node pred, DataFlow::Node succ, PathSummary summary
|
||||
) {
|
||||
basicFlowStep(pred, succ, summary)
|
||||
or
|
||||
// Flow through a function that returns a value that depends on one of its arguments
|
||||
// or a captured variable
|
||||
flowThroughCall(pred, succ) and
|
||||
summary = PathSummary::level()
|
||||
or
|
||||
// Flow through a property write/read pair
|
||||
flowThroughProperty(pred, succ, summary)
|
||||
or
|
||||
// Flow into higher-order call
|
||||
flowIntoHigherOrderCall(pred, succ, summary)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if there is a path from `source` to `nd` along a path summarized by
|
||||
* `summary`.
|
||||
*/
|
||||
deprecated predicate flowsTo(TrackedNode source, DataFlow::Node nd, PathSummary summary) {
|
||||
source = nd and
|
||||
summary = PathSummary::level()
|
||||
or
|
||||
exists(DataFlow::Node pred, PathSummary oldSummary, PathSummary newSummary |
|
||||
flowsTo(source, pred, oldSummary) and
|
||||
flowStep(pred, nd, newSummary) and
|
||||
summary = oldSummary.append(newSummary)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,8 +71,6 @@ class ClientRequest extends DataFlow::InvokeNode instanceof ClientRequest::Range
|
||||
DataFlow::Node getASavePath() { result = super.getASavePath() }
|
||||
}
|
||||
|
||||
deprecated class CustomClientRequest = ClientRequest::Range;
|
||||
|
||||
module ClientRequest {
|
||||
/**
|
||||
* A call that performs a request to a URL.
|
||||
|
||||
@@ -189,8 +189,6 @@ module Electron {
|
||||
abstract class Range extends NodeJSLib::NodeJSClientRequest::Range { }
|
||||
}
|
||||
|
||||
deprecated class CustomElectronClientRequest = ElectronClientRequest::Range;
|
||||
|
||||
/**
|
||||
* A Node.js-style HTTP or HTTPS request made using `electron.ClientRequest`.
|
||||
*/
|
||||
|
||||
@@ -104,13 +104,6 @@ module HTTP {
|
||||
predicate isUnsafe() { not this.isSafe() }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `http` or `https` directly as appropriate.
|
||||
*
|
||||
* Gets the string `http` or `https`.
|
||||
*/
|
||||
deprecated string httpOrHttps() { result = "http" or result = "https" }
|
||||
|
||||
/**
|
||||
* An expression whose value is sent as (part of) the body of an HTTP response.
|
||||
*/
|
||||
|
||||
@@ -5,22 +5,6 @@
|
||||
import javascript
|
||||
|
||||
module LazyCache {
|
||||
/**
|
||||
* DEPRECATED. DO NOT USE.
|
||||
*
|
||||
* A lazy-cache object, usually created through an expression of form `require('lazy-cache')(require)`.
|
||||
*/
|
||||
deprecated class LazyCacheObject extends DataFlow::SourceNode {
|
||||
LazyCacheObject() {
|
||||
// Use `require` directly instead of `moduleImport` to avoid recursion.
|
||||
// For the same reason, avoid `Import.getImportedPath`.
|
||||
exists(Require req |
|
||||
req.getArgument(0).getStringValue() = "lazy-cache" and
|
||||
this = req.flow().(DataFlow::SourceNode).getAnInvocation()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A variable containing a lazy-cache object.
|
||||
*/
|
||||
|
||||
@@ -801,11 +801,6 @@ module NodeJSLib {
|
||||
TrackedRouteHandlerCandidateWithSetup() { this = any(RouteSetup s).getARouteHandler() }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED Use `VmModuleMemberInvocation` instead.
|
||||
*/
|
||||
deprecated class VmModuleMethodCall = VmModuleMemberInvocation;
|
||||
|
||||
/**
|
||||
* An invocation of a member from module `vm`
|
||||
*/
|
||||
@@ -864,8 +859,6 @@ module NodeJSLib {
|
||||
abstract class Range extends ClientRequest::Range { }
|
||||
}
|
||||
|
||||
deprecated class CustomNodeJSClientRequest = NodeJSClientRequest::Range;
|
||||
|
||||
/**
|
||||
* A model of a URL request in the Node.js `http` library.
|
||||
*/
|
||||
|
||||
@@ -59,8 +59,6 @@ module PropertyProjection {
|
||||
}
|
||||
}
|
||||
|
||||
deprecated class CustomPropertyProjection = PropertyProjection::Range;
|
||||
|
||||
/**
|
||||
* Gets a callee of a simple property projection call.
|
||||
* This predicate is used exclusively in `SimplePropertyProjection`.
|
||||
|
||||
@@ -82,11 +82,6 @@ module SocketIO {
|
||||
}
|
||||
|
||||
override DataFlow::SourceNode ref() { result = this.server().getAUse() }
|
||||
|
||||
/**
|
||||
* DEPRECATED. Always returns `this` as a `ServerObject` now represents the origin of a server.
|
||||
*/
|
||||
deprecated DataFlow::SourceNode getOrigin() { result = this }
|
||||
}
|
||||
|
||||
/** A data flow node that may produce (that is, create or return) a socket.io server. */
|
||||
|
||||
@@ -9,18 +9,6 @@ import javascript
|
||||
*/
|
||||
predicate jquery = JQuery::dollar/0;
|
||||
|
||||
/**
|
||||
* DEPRECATED. In most cases, `JQuery::Object` should be used instead.
|
||||
* Alternatively, if used as a base class, and the intent is to extend the model of
|
||||
* jQuery objects with more nodes, extend `JQuery::ObjectSource::Range` instead.
|
||||
*
|
||||
* An expression that may refer to a jQuery object.
|
||||
*
|
||||
* Note that this class is an over-approximation: `nd instanceof JQueryObject`
|
||||
* may hold for nodes `nd` that cannot, in fact, refer to a jQuery object.
|
||||
*/
|
||||
deprecated class JQueryObject = JQueryObjectInternal;
|
||||
|
||||
/**
|
||||
* An internal version of `JQueryObject` that may be used to retain
|
||||
* backwards compatibility without triggering a deprecation warning.
|
||||
@@ -80,44 +68,6 @@ private predicate neverReturnsJQuery(string name) {
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED. Use `JQuery::MethodCall` instead.
|
||||
*
|
||||
* A (possibly chained) call to a jQuery method.
|
||||
*/
|
||||
deprecated class JQueryMethodCall extends CallExpr {
|
||||
string name;
|
||||
|
||||
JQueryMethodCall() { name = this.flow().(JQuery::MethodCall).getMethodName() }
|
||||
|
||||
/**
|
||||
* Gets the name of the jQuery method this call invokes.
|
||||
*/
|
||||
string getMethodName() { result = name }
|
||||
|
||||
/**
|
||||
* Holds if `e` is an argument that this method may interpret as HTML.
|
||||
*
|
||||
* Note that some jQuery methods decide whether to interpret an argument
|
||||
* as HTML based on its syntactic shape, so this predicate and
|
||||
* `interpretsArgumentAsSelector` below overlap.
|
||||
*/
|
||||
predicate interpretsArgumentAsHtml(Expr e) {
|
||||
this.flow().(JQuery::MethodCall).interpretsArgumentAsHtml(e.flow())
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `e` is an argument that this method may interpret as a selector.
|
||||
*
|
||||
* Note that some jQuery methods decide whether to interpret an argument
|
||||
* as a selector based on its syntactic shape, so this predicate and
|
||||
* `interpretsArgumentAsHtml` above overlap.
|
||||
*/
|
||||
predicate interpretsArgumentAsSelector(Expr e) {
|
||||
this.flow().(JQuery::MethodCall).interpretsArgumentAsSelector(e.flow())
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A call to `jQuery.parseXML`.
|
||||
*/
|
||||
|
||||
@@ -6,15 +6,6 @@
|
||||
|
||||
import javascript
|
||||
|
||||
/**
|
||||
* DEPRECATED.
|
||||
*
|
||||
* The target of a heuristic additional flow step in a security query.
|
||||
*/
|
||||
deprecated class HeuristicAdditionalTaintStep extends DataFlow::Node {
|
||||
HeuristicAdditionalTaintStep() { any(TaintTracking::SharedTaintStep step).heuristicStep(_, this) }
|
||||
}
|
||||
|
||||
/**
|
||||
* A call to `tainted.replace(x, y)` that preserves taint.
|
||||
*/
|
||||
|
||||
@@ -23,11 +23,6 @@ module HttpToFileAccess {
|
||||
*/
|
||||
abstract class Sanitizer extends DataFlow::Node { }
|
||||
|
||||
/** A source of remote user input, considered as a flow source for writing user-controlled data to files. */
|
||||
deprecated class RemoteFlowSourceAsSource extends DataFlow::Node {
|
||||
RemoteFlowSourceAsSource() { this instanceof RemoteFlowSource }
|
||||
}
|
||||
|
||||
/**
|
||||
* An access to a user-controlled HTTP request input, considered as a flow source for writing user-controlled data to files
|
||||
*/
|
||||
|
||||
@@ -53,11 +53,6 @@ module PrototypePollution {
|
||||
*/
|
||||
abstract DataFlow::FlowLabel getAFlowLabel();
|
||||
|
||||
/**
|
||||
* DEPRECATED. Override `dependencyInfo` instead.
|
||||
*/
|
||||
deprecated Dependency getDependency() { none() }
|
||||
|
||||
/**
|
||||
* Holds if `moduleName` is the name of the module that defines this sink,
|
||||
* and `location` is the declaration of that dependency.
|
||||
@@ -120,11 +115,6 @@ module PrototypePollution {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED. Use `isVulnerableVersionOfDeepExtendCall` or `isVulnerableDeepExtendCallAllVersions` instead.
|
||||
*/
|
||||
deprecated predicate isVulnerableDeepExtendCall = isVulnerableVersionOfDeepExtendCall/2;
|
||||
|
||||
/**
|
||||
* Holds if `call` is vulnerable to prototype pollution because the callee is defined by `dep`.
|
||||
*/
|
||||
|
||||
@@ -85,12 +85,6 @@ class ClassDef extends Assign {
|
||||
|
||||
/** The scope of a class. This is the scope of all the statements within the class definition */
|
||||
class Class extends Class_, Scope, AstNode {
|
||||
/**
|
||||
* Use getADecorator() instead of getDefinition().getADecorator()
|
||||
* Use getMetaClass() instead of getDefinition().getMetaClass()
|
||||
*/
|
||||
deprecated ClassExpr getDefinition() { result = this.getParent() }
|
||||
|
||||
/** Gets a defined init method of this class */
|
||||
Function getInitMethod() { result.getScope() = this and result.isInitMethod() }
|
||||
|
||||
|
||||
@@ -30,9 +30,6 @@ class Expr extends Expr_, AstNode {
|
||||
/** Whether this expression is a constant */
|
||||
predicate isConstant() { not this.isVariable() }
|
||||
|
||||
/** Use isParenthesized instead. */
|
||||
deprecated override predicate isParenthesised() { this.isParenthesized() }
|
||||
|
||||
/** Whether the parenthesized property of this expression is true. */
|
||||
predicate isParenthesized() { Expr_.super.isParenthesised() }
|
||||
|
||||
@@ -49,9 +46,6 @@ class Expr extends Expr_, AstNode {
|
||||
/** Gets an immediate (non-nested) sub-expression of this expression */
|
||||
Expr getASubExpression() { none() }
|
||||
|
||||
/** Use StrConst.getText() instead */
|
||||
deprecated string strValue() { none() }
|
||||
|
||||
override AstNode getAChildNode() { result = this.getASubExpression() }
|
||||
|
||||
/**
|
||||
@@ -622,8 +616,6 @@ class StrConst extends Str_, ImmutableLiteral {
|
||||
)
|
||||
}
|
||||
|
||||
deprecated override string strValue() { result = this.getS() }
|
||||
|
||||
override Expr getASubExpression() { none() }
|
||||
|
||||
override AstNode getAChildNode() { result = this.getAnImplicitlyConcatenatedPart() }
|
||||
|
||||
@@ -2,12 +2,6 @@ import python
|
||||
|
||||
/** A file */
|
||||
class File extends Container, @file {
|
||||
/** DEPRECATED: Use `getAbsolutePath` instead. */
|
||||
deprecated override string getName() { result = this.getAbsolutePath() }
|
||||
|
||||
/** DEPRECATED: Use `getAbsolutePath` instead. */
|
||||
deprecated string getFullName() { result = this.getAbsolutePath() }
|
||||
|
||||
/**
|
||||
* Holds if this element is at the specified location.
|
||||
* The location spans column `startcolumn` of line `startline` to
|
||||
@@ -115,9 +109,6 @@ private predicate occupied_line(File f, int n) {
|
||||
|
||||
/** A folder (directory) */
|
||||
class Folder extends Container, @folder {
|
||||
/** DEPRECATED: Use `getAbsolutePath` instead. */
|
||||
deprecated override string getName() { result = this.getAbsolutePath() }
|
||||
|
||||
/**
|
||||
* Holds if this element is at the specified location.
|
||||
* The location spans column `startcolumn` of line `startline` to
|
||||
@@ -156,9 +147,6 @@ class Folder extends Container, @folder {
|
||||
abstract class Container extends @container {
|
||||
Container getParent() { containerparent(result, this) }
|
||||
|
||||
/** Gets a child of this container */
|
||||
deprecated Container getChild() { containerparent(this, result) }
|
||||
|
||||
/**
|
||||
* Gets a textual representation of the path of this container.
|
||||
*
|
||||
|
||||
@@ -82,30 +82,12 @@ class ControlFlowNode extends @py_flow_node {
|
||||
toAst(this) instanceof NameConstant
|
||||
}
|
||||
|
||||
/** Use NameNode.isLoad() instead */
|
||||
deprecated predicate isUse() { toAst(this) instanceof Name and this.isLoad() }
|
||||
|
||||
/** Use NameNode.isStore() */
|
||||
deprecated predicate isDefinition() { toAst(this) instanceof Name and this.isStore() }
|
||||
|
||||
/** Whether this flow node corresponds to an attribute expression */
|
||||
predicate isAttribute() { toAst(this) instanceof Attribute }
|
||||
|
||||
/** Use AttrNode.isLoad() instead */
|
||||
deprecated predicate isAttributeLoad() { toAst(this) instanceof Attribute and this.isLoad() }
|
||||
|
||||
/** Use AttrNode.isStore() instead */
|
||||
deprecated predicate isAttributeStore() { toAst(this) instanceof Attribute and this.isStore() }
|
||||
|
||||
/** Whether this flow node corresponds to an subscript expression */
|
||||
predicate isSubscript() { toAst(this) instanceof Subscript }
|
||||
|
||||
/** Use SubscriptNode.isLoad() instead */
|
||||
deprecated predicate isSubscriptLoad() { toAst(this) instanceof Subscript and this.isLoad() }
|
||||
|
||||
/** Use SubscriptNode.isStore() instead */
|
||||
deprecated predicate isSubscriptStore() { toAst(this) instanceof Subscript and this.isStore() }
|
||||
|
||||
/** Whether this flow node corresponds to an import member */
|
||||
predicate isImportMember() { toAst(this) instanceof ImportMember }
|
||||
|
||||
@@ -439,12 +421,6 @@ class AttrNode extends ControlFlowNode {
|
||||
)
|
||||
}
|
||||
|
||||
/** Use getObject() instead */
|
||||
deprecated ControlFlowNode getValue() { result = this.getObject() }
|
||||
|
||||
/** Use getObject(name) instead */
|
||||
deprecated ControlFlowNode getValue(string name) { result = this.getObject(name) }
|
||||
|
||||
/**
|
||||
* Gets the flow node corresponding to the object of the attribute expression corresponding to this flow node,
|
||||
* with the matching name
|
||||
@@ -507,18 +483,6 @@ class ImportStarNode extends ControlFlowNode {
|
||||
class SubscriptNode extends ControlFlowNode {
|
||||
SubscriptNode() { toAst(this) instanceof Subscript }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `getObject()` instead.
|
||||
* This will be formally deprecated before the end 2018 and removed in 2019.
|
||||
*/
|
||||
deprecated ControlFlowNode getValue() {
|
||||
exists(Subscript s |
|
||||
this.getNode() = s and
|
||||
s.getObject() = result.getNode() and
|
||||
result.getBasicBlock().dominates(this.getBasicBlock())
|
||||
)
|
||||
}
|
||||
|
||||
/** flow node corresponding to the value of the sequence in a subscript operation */
|
||||
ControlFlowNode getObject() {
|
||||
exists(Subscript s |
|
||||
@@ -950,10 +914,6 @@ class NameNode extends ControlFlowNode {
|
||||
/** A control flow node corresponding to a named constant, one of `None`, `True` or `False`. */
|
||||
class NameConstantNode extends NameNode {
|
||||
NameConstantNode() { exists(NameConstant n | py_flow_bb_node(this, n, _, _)) }
|
||||
|
||||
deprecated override predicate defines(Variable v) { none() }
|
||||
|
||||
deprecated override predicate deletes(Variable v) { none() }
|
||||
/*
|
||||
* We ought to override uses as well, but that has
|
||||
* a serious performance impact.
|
||||
|
||||
@@ -167,13 +167,6 @@ class Import extends Import_ {
|
||||
result = this.getAName().getValue().(ImportMember).getModule()
|
||||
}
|
||||
|
||||
/**
|
||||
* Use getAnImportedModuleName(),
|
||||
* possibly combined with ModuleObject.importedAs()
|
||||
* Gets a module imported by this import statement
|
||||
*/
|
||||
deprecated Module getAModule() { result.getName() = this.getAnImportedModuleName() }
|
||||
|
||||
/** Whether this a `from ... import ...` statement */
|
||||
predicate isFromImport() { this.getAName().getValue() instanceof ImportMember }
|
||||
|
||||
@@ -218,13 +211,6 @@ class ImportStar extends ImportStar_ {
|
||||
|
||||
override string toString() { result = "from " + this.getModuleExpr().getName() + " import *" }
|
||||
|
||||
/**
|
||||
* Use getAnImportedModuleName(),
|
||||
* possibly combined with ModuleObject.importedAs()
|
||||
* Gets the module imported by this import * statement
|
||||
*/
|
||||
deprecated Module getTheModule() { result.getName() = this.getImportedModuleName() }
|
||||
|
||||
override Expr getASubExpression() { result = this.getModule() }
|
||||
|
||||
override Stmt getASubStatement() { none() }
|
||||
|
||||
@@ -99,12 +99,6 @@ class Module extends Module_, Scope, AstNode {
|
||||
/** Gets the metrics for this module */
|
||||
ModuleMetrics getMetrics() { result = this }
|
||||
|
||||
/**
|
||||
* Use ModuleObject.getAnImportedModule() instead.
|
||||
* Gets a module imported by this module
|
||||
*/
|
||||
deprecated Module getAnImportedModule() { result.getName() = this.getAnImportedModuleName() }
|
||||
|
||||
string getAnImportedModuleName() {
|
||||
exists(Import i | i.getEnclosingModule() = this | result = i.getAnImportedModuleName())
|
||||
or
|
||||
|
||||
@@ -121,14 +121,6 @@ module TaintTracking {
|
||||
|
||||
/* Old query API */
|
||||
/* deprecated */
|
||||
deprecated predicate hasFlow(Source src, Sink sink) {
|
||||
exists(PathSource psrc, PathSink psink |
|
||||
this.hasFlowPath(psrc, psink) and
|
||||
src = psrc.getNode().asCfgNode() and
|
||||
sink = psink.getNode().asCfgNode()
|
||||
)
|
||||
}
|
||||
|
||||
/* New query API */
|
||||
predicate hasSimpleFlow(DataFlow::Node src, DataFlow::Node sink) {
|
||||
exists(PathSource psrc, PathSink psink |
|
||||
|
||||
@@ -3,22 +3,6 @@ private import semmle.python.objects.ObjectInternal
|
||||
import semmle.python.dataflow.Implementation
|
||||
|
||||
/* For backwards compatibility -- Use `TaintTrackingContext` instead. */
|
||||
deprecated class CallContext extends TaintTrackingContext {
|
||||
TaintTrackingContext getCallee(CallNode call) { result.getCaller(call) = this }
|
||||
|
||||
predicate appliesToScope(Scope s) {
|
||||
exists(PythonFunctionObjectInternal func, TaintKind param, AttributePath path, int n |
|
||||
this = TParamContext(param, path, n) and
|
||||
exists(TaintTrackingImplementation impl |
|
||||
impl.callWithTaintedArgument(_, _, _, func, n, path, param) and
|
||||
s = func.getScope()
|
||||
)
|
||||
)
|
||||
or
|
||||
this.isTop() and exists(s)
|
||||
}
|
||||
}
|
||||
|
||||
/* Backwards compatibility with config-less taint-tracking */
|
||||
private class LegacyConfiguration extends TaintTracking::Configuration {
|
||||
LegacyConfiguration() {
|
||||
|
||||
@@ -138,9 +138,6 @@ abstract class TaintKind extends string {
|
||||
exists(TaintedNode n | n.getTaintKind() = this and n.getCfgNode() = expr)
|
||||
}
|
||||
|
||||
/** DEPRECATED -- Use getType() instead */
|
||||
deprecated ClassObject getClass() { none() }
|
||||
|
||||
/**
|
||||
* Gets the class of this kind of taint.
|
||||
* For example, if this were a kind of string taint
|
||||
@@ -613,32 +610,6 @@ module DataFlow {
|
||||
*/
|
||||
class Extension = DataFlowExtension::DataFlowNode;
|
||||
|
||||
abstract deprecated class Configuration extends string {
|
||||
bindingset[this]
|
||||
Configuration() { this = this }
|
||||
|
||||
abstract predicate isSource(ControlFlowNode source);
|
||||
|
||||
abstract predicate isSink(ControlFlowNode sink);
|
||||
|
||||
private predicate hasFlowPath(TaintedNode source, TaintedNode sink) {
|
||||
source.getConfiguration() = this and
|
||||
this.isSource(source.getCfgNode()) and
|
||||
this.isSink(sink.getCfgNode()) and
|
||||
source.flowsTo(sink)
|
||||
}
|
||||
|
||||
predicate hasFlow(ControlFlowNode source, ControlFlowNode sink) {
|
||||
exists(TaintedNode psource, TaintedNode psink |
|
||||
psource.getCfgNode() = source and
|
||||
psink.getCfgNode() = sink and
|
||||
this.isSource(source) and
|
||||
this.isSink(sink) and
|
||||
this.hasFlowPath(psource, psink)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
deprecated private class ConfigurationAdapter extends TaintTracking::Configuration instanceof Configuration {
|
||||
override predicate isSource(DataFlow::Node node, TaintKind kind) {
|
||||
Configuration.super.isSource(node.asCfgNode()) and
|
||||
@@ -670,9 +641,6 @@ module DataFlow {
|
||||
abstract Location getLocation();
|
||||
|
||||
AstNode asAstNode() { result = this.asCfgNode().getNode() }
|
||||
|
||||
/** For backwards compatibility -- Use asAstNode() instead */
|
||||
deprecated AstNode getNode() { result = this.asAstNode() }
|
||||
}
|
||||
|
||||
class CfgNode extends Node, TCfgNode {
|
||||
@@ -708,13 +676,6 @@ module DataFlow {
|
||||
}
|
||||
}
|
||||
|
||||
deprecated private class DataFlowType extends TaintKind {
|
||||
DataFlowType() {
|
||||
this = "Data flow" and
|
||||
exists(DataFlow::Configuration c)
|
||||
}
|
||||
}
|
||||
|
||||
pragma[noinline]
|
||||
private predicate dict_construct(ControlFlowNode itemnode, ControlFlowNode dictnode) {
|
||||
dictnode.(DictNode).getAValue() = itemnode
|
||||
|
||||
@@ -495,11 +495,7 @@ private EssaVariable potential_input(EssaNodeRefinement ref) {
|
||||
}
|
||||
|
||||
/* For backwards compatibility */
|
||||
deprecated class PyNodeDefinition = EssaNodeDefinition;
|
||||
|
||||
/* For backwards compatibility */
|
||||
deprecated class PyNodeRefinement = EssaNodeRefinement;
|
||||
|
||||
/** An assignment to a variable `v = val` */
|
||||
class AssignmentDefinition extends EssaNodeDefinition {
|
||||
AssignmentDefinition() {
|
||||
|
||||
@@ -3,26 +3,6 @@
|
||||
import python
|
||||
private import semmle.python.pointsto.PointsTo
|
||||
|
||||
/** A method that to a sub-class of `zope.interface.Interface` */
|
||||
deprecated class ZopeInterfaceMethod extends PyFunctionObject {
|
||||
/** Holds if this method belongs to a class that sub-classes `zope.interface.Interface` */
|
||||
ZopeInterfaceMethod() {
|
||||
exists(Object interface, ClassObject owner |
|
||||
interface = ModuleObject::named("zope.interface").attr("Interface") and
|
||||
owner.declaredAttribute(_) = this and
|
||||
owner.getAnImproperSuperType().getABaseType() = interface
|
||||
)
|
||||
}
|
||||
|
||||
override int minParameters() { result = super.minParameters() + 1 }
|
||||
|
||||
override int maxParameters() {
|
||||
if exists(this.getFunction().getVararg())
|
||||
then result = super.maxParameters()
|
||||
else result = super.maxParameters() + 1
|
||||
}
|
||||
}
|
||||
|
||||
/** A method that belongs to a sub-class of `zope.interface.Interface` */
|
||||
class ZopeInterfaceMethodValue extends PythonFunctionValue {
|
||||
/** Holds if this method belongs to a class that sub-classes `zope.interface.Interface` */
|
||||
|
||||
@@ -190,17 +190,6 @@ private newtype TIterationDefinition =
|
||||
SsaSource::iteration_defined_variable(var, def, sequence)
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED. For backwards compatibility only.
|
||||
* A definition of a variable in a for loop `for v in ...:`
|
||||
*/
|
||||
deprecated class IterationDefinition extends TIterationDefinition {
|
||||
/** Gets a textual representation of this element. */
|
||||
string toString() { result = "IterationDefinition" }
|
||||
|
||||
ControlFlowNode getSequence() { this = TIterationDefinition_(_, _, result) }
|
||||
}
|
||||
|
||||
/** Hold if outer contains inner, both are contained within a test and inner is a use is a plain use or an attribute lookup */
|
||||
pragma[noinline]
|
||||
predicate contains_interesting_expression_within_test(ControlFlowNode outer, ControlFlowNode inner) {
|
||||
|
||||
@@ -1,5 +1,2 @@
|
||||
/* For backwards compatibility */
|
||||
import PointsTo::PointsTo as P
|
||||
|
||||
/** DEPRECATED: Use `PointsTo` instead */
|
||||
deprecated module FinalPointsTo = P;
|
||||
|
||||
@@ -145,24 +145,6 @@ module PointsTo {
|
||||
)
|
||||
}
|
||||
|
||||
deprecated predicate ssa_variable_points_to(
|
||||
EssaVariable var, PointsToContext context, Object obj, ClassObject cls, CfgOrigin origin
|
||||
) {
|
||||
exists(ObjectInternal value |
|
||||
PointsToInternal::variablePointsTo(var, context, value, origin) and
|
||||
cls = value.getClass().getSource()
|
||||
|
|
||||
obj = value.getSource()
|
||||
)
|
||||
}
|
||||
|
||||
deprecated CallNode get_a_call(Object func, PointsToContext context) {
|
||||
exists(ObjectInternal value |
|
||||
result = value.(Value).getACall(context) and
|
||||
func = value.getSource()
|
||||
)
|
||||
}
|
||||
|
||||
cached
|
||||
predicate moduleExports(ModuleObjectInternal mod, string name) {
|
||||
InterModulePointsTo::moduleExportsBoolean(mod, name) = true
|
||||
|
||||
@@ -30,40 +30,7 @@ abstract class PointsToExtension extends @py_flow_node {
|
||||
* sources of data to the points-to analysis.
|
||||
*/
|
||||
|
||||
/** DEPRECATED -- Use PointsToExtension instead */
|
||||
abstract deprecated class CustomPointsToFact extends @py_flow_node {
|
||||
string toString() { result = "CustomPointsToFact with missing toString" }
|
||||
|
||||
abstract predicate pointsTo(Context context, Object value, ClassObject cls, ControlFlowNode origin);
|
||||
}
|
||||
|
||||
/** DEPRECATED -- Use PointsToExtension instead */
|
||||
deprecated class FinalCustomPointsToFact = CustomPointsToFact;
|
||||
|
||||
abstract deprecated class CustomPointsToOriginFact extends CustomPointsToFact {
|
||||
abstract predicate pointsTo(Object value, ClassObject cls);
|
||||
|
||||
override predicate pointsTo(Context context, Object value, ClassObject cls, ControlFlowNode origin) {
|
||||
this.pointsTo(value, cls) and origin = this and context.appliesTo(this)
|
||||
}
|
||||
}
|
||||
|
||||
/* Custom points-to fact with inferred class */
|
||||
abstract deprecated class CustomPointsToObjectFact extends CustomPointsToFact {
|
||||
abstract predicate pointsTo(Object value);
|
||||
|
||||
override predicate pointsTo(Context context, Object value, ClassObject cls, ControlFlowNode origin) {
|
||||
this.pointsTo(value) and cls = simple_types(value) and origin = this and context.appliesTo(this)
|
||||
}
|
||||
}
|
||||
|
||||
/** DEPRECATED -- Unsupported; do not use */
|
||||
abstract deprecated class CustomPointsToAttribute extends Object {
|
||||
abstract predicate attributePointsTo(
|
||||
string name, Object value, ClassObject cls, ControlFlowNode origin
|
||||
);
|
||||
}
|
||||
|
||||
/* An example */
|
||||
/** An extension representing the fact that a variable iterating over range or xrange must be an integer */
|
||||
class RangeIterationVariableFact extends PointsToExtension {
|
||||
@@ -164,19 +131,3 @@ deprecated private class BackwardCompatiblePointToExtension extends PointsToExte
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
deprecated private predicate additionalAttribute(
|
||||
ObjectInternal owner, string name, ObjectInternal value, ControlFlowNode origin
|
||||
) {
|
||||
exists(Object obj, ClassObject cls |
|
||||
owner.getSource().(CustomPointsToAttribute).attributePointsTo(name, obj, cls, origin)
|
||||
|
|
||||
value.getBuiltin() = obj
|
||||
or
|
||||
obj instanceof ControlFlowNode and
|
||||
exists(ClassObjectInternal c |
|
||||
c.getSource() = cls and
|
||||
value = TUnknownInstance(c)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -29,9 +29,6 @@ abstract class FunctionObject extends Object {
|
||||
/** Whether this function raises an exception, the class of which cannot be inferred */
|
||||
abstract predicate raisesUnknownType();
|
||||
|
||||
/** Use descriptiveString() instead. */
|
||||
deprecated string prettyString() { result = this.descriptiveString() }
|
||||
|
||||
/** Gets a longer, more descriptive version of toString() */
|
||||
abstract string descriptiveString();
|
||||
|
||||
@@ -311,33 +308,3 @@ class BuiltinFunctionObject extends BuiltinCallable {
|
||||
|
||||
override int maxParameters() { none() }
|
||||
}
|
||||
|
||||
/** DEPRECATED -- Use `Object::builtin("apply")` instead. */
|
||||
deprecated Object theApplyFunction() { result = Object::builtin("apply") }
|
||||
|
||||
/** DEPRECATED -- Use `Object::builtin("hasattr")` instead. */
|
||||
deprecated Object theHasattrFunction() { result = Object::builtin("hasattr") }
|
||||
|
||||
/** DEPRECATED -- Use `Object::builtin("len")` instead. */
|
||||
deprecated Object theLenFunction() { result = Object::builtin("len") }
|
||||
|
||||
/** DEPRECATED -- Use `Object::builtin("format")` instead. */
|
||||
deprecated Object theFormatFunction() { result = Object::builtin("format") }
|
||||
|
||||
/** DEPRECATED -- Use `Object::builtin("open")` instead. */
|
||||
deprecated Object theOpenFunction() { result = Object::builtin("open") }
|
||||
|
||||
/** DEPRECATED -- Use `Object::builtin("print")` instead. */
|
||||
deprecated Object thePrintFunction() { result = Object::builtin("print") }
|
||||
|
||||
/** DEPRECATED -- Use `Object::builtin("input")` instead. */
|
||||
deprecated Object theInputFunction() { result = Object::builtin("input") }
|
||||
|
||||
/** DEPRECATED -- Use `Object::builtin("locals")` instead. */
|
||||
deprecated Object theLocalsFunction() { result = Object::builtin("locals") }
|
||||
|
||||
/** DEPRECATED -- Use `Object::builtin("globals")()` instead. */
|
||||
deprecated Object theGlobalsFunction() { result = Object::builtin("globals") }
|
||||
|
||||
/** DEPRECATED -- Use `Object::builtin("sysExit()` instead. */
|
||||
deprecated Object theExitFunctionObject() { result = ModuleObject::named("sys").attr("exit") }
|
||||
|
||||
@@ -74,13 +74,6 @@ abstract class ModuleObject extends Object {
|
||||
*/
|
||||
predicate exports(string name) { this.theModule().exports(name) }
|
||||
|
||||
/**
|
||||
* Whether the complete set of names "exported" by this module can be accurately determined
|
||||
*
|
||||
* DEPRECATED: Use ModuleValue::hasCompleteExportInfo instead
|
||||
*/
|
||||
abstract deprecated predicate exportsComplete();
|
||||
|
||||
/** Gets the short name of the module. For example the short name of module x.y.z is 'z' */
|
||||
string getShortName() {
|
||||
result = this.getName().suffix(this.getPackage().getName().length() + 1)
|
||||
@@ -117,8 +110,6 @@ class BuiltinModuleObject extends ModuleObject {
|
||||
}
|
||||
|
||||
override predicate hasAttribute(string name) { exists(this.asBuiltin().getMember(name)) }
|
||||
|
||||
deprecated override predicate exportsComplete() { any() }
|
||||
}
|
||||
|
||||
class PythonModuleObject extends ModuleObject {
|
||||
@@ -131,18 +122,6 @@ class PythonModuleObject extends ModuleObject {
|
||||
override Module getSourceModule() { result = this.getOrigin() }
|
||||
|
||||
override Container getPath() { result = this.getModule().getFile() }
|
||||
|
||||
deprecated override predicate exportsComplete() {
|
||||
exists(Module m | m = this.getModule() |
|
||||
not exists(Call modify, Attribute attr, GlobalVariable all |
|
||||
modify.getScope() = m and
|
||||
modify.getFunc() = attr and
|
||||
all.getId() = "__all__"
|
||||
|
|
||||
attr.getObject().(Name).uses(all)
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -196,12 +175,6 @@ class PackageObject extends ModuleObject {
|
||||
)
|
||||
}
|
||||
|
||||
deprecated override predicate exportsComplete() {
|
||||
not exists(this.getInitModule())
|
||||
or
|
||||
this.getInitModule().exportsComplete()
|
||||
}
|
||||
|
||||
override predicate hasAttribute(string name) {
|
||||
exists(this.submodule(name))
|
||||
or
|
||||
|
||||
@@ -366,9 +366,6 @@ BuiltinModuleObject theBuiltinModuleObject() { result.asBuiltin() = Builtin::bui
|
||||
/** Gets the `sys` module */
|
||||
BuiltinModuleObject theSysModuleObject() { result.asBuiltin() = Builtin::special("sys") }
|
||||
|
||||
/** DEPRECATED -- Use `Object::builtin(name)` instead. */
|
||||
deprecated Object builtin_object(string name) { result = Object::builtin(name) }
|
||||
|
||||
/** Gets the built-in object None */
|
||||
Object theNoneObject() { result.asBuiltin() = Builtin::special("None") }
|
||||
|
||||
@@ -390,15 +387,6 @@ Object theIndexErrorType() { result = Object::builtin("IndexError") }
|
||||
/** Gets the LookupError class */
|
||||
Object theLookupErrorType() { result = Object::builtin("LookupError") }
|
||||
|
||||
/** DEPRECATED -- Use `Object::quitter(name)` instead. */
|
||||
deprecated Object quitterObject(string name) { result = Object::quitter(name) }
|
||||
|
||||
/** DEPRECATED -- Use `Object::notImplemented()` instead. */
|
||||
deprecated Object theNotImplementedObject() { result = Object::builtin("NotImplemented") }
|
||||
|
||||
/** DEPRECATED -- Use `TupleObject::empty()` instead. */
|
||||
deprecated Object theEmptyTupleObject() { result = TupleObject::empty() }
|
||||
|
||||
module Object {
|
||||
Object builtin(string name) { result.asBuiltin() = Builtin::builtin(name) }
|
||||
|
||||
|
||||
@@ -21,9 +21,6 @@ deprecated class DjangoShortcutsRedirectSink extends HttpRedirectTaintSink {
|
||||
}
|
||||
}
|
||||
|
||||
/** DEPRECATED: Use `DjangoShortcutsRedirectSink` instead. */
|
||||
deprecated class DjangoRedirect = DjangoShortcutsRedirectSink;
|
||||
|
||||
/**
|
||||
* The URL argument when instantiating a Django Redirect Response.
|
||||
*/
|
||||
|
||||
@@ -4,16 +4,6 @@ import semmle.python.security.strings.Basic
|
||||
private import semmle.python.web.django.Shared
|
||||
private import semmle.python.web.Http
|
||||
|
||||
/**
|
||||
* DEPRECATED: This class is internal to the django library modeling, and should
|
||||
* never be used by anyone.
|
||||
*
|
||||
* A django.http.response.Response object
|
||||
* This isn't really a "taint", but we use the value tracking machinery to
|
||||
* track the flow of response objects.
|
||||
*/
|
||||
deprecated class DjangoResponse = DjangoResponseKind;
|
||||
|
||||
/** INTERNAL class used for tracking a django response object. */
|
||||
deprecated private class DjangoResponseKind extends TaintKind {
|
||||
DjangoResponseKind() { this = "django.response.HttpResponse" }
|
||||
|
||||
@@ -1,17 +1,5 @@
|
||||
import python
|
||||
|
||||
/** DEPRECATED: Use `Value::named("django.shortcuts.redirect")` instead. */
|
||||
deprecated FunctionValue redirect() { result = Value::named("django.shortcuts.redirect") }
|
||||
|
||||
/** DEPRECATED: Use `DjangoRedirectResponseClass` instead. */
|
||||
deprecated ClassValue theDjangoHttpRedirectClass() {
|
||||
// version 1.x
|
||||
result = Value::named("django.http.response.HttpResponseRedirectBase")
|
||||
or
|
||||
// version 2.x
|
||||
result = Value::named("django.http.HttpResponseRedirectBase")
|
||||
}
|
||||
|
||||
/** A class that is a Django Redirect Response (subclass of `django.http.HttpResponseRedirectBase`). */
|
||||
deprecated class DjangoRedirectResponseClass extends ClassValue {
|
||||
DjangoRedirectResponseClass() {
|
||||
|
||||
@@ -12,13 +12,6 @@ class XMLLocatable extends @xmllocatable, TXMLLocatable {
|
||||
/** Gets the source location for this element. */
|
||||
Location getLocation() { xmllocations(this, result) }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `getLocation()` instead.
|
||||
*
|
||||
* Gets the source location for this element.
|
||||
*/
|
||||
deprecated Location getALocation() { result = this.getLocation() }
|
||||
|
||||
/**
|
||||
* Holds if this element is at the specified location.
|
||||
* The location spans column `startcolumn` of line `startline` to
|
||||
@@ -83,21 +76,6 @@ class XMLParent extends @xmlparent {
|
||||
/** Gets the number of places in the body of this XML parent where text occurs. */
|
||||
int getNumberOfCharacterSets() { result = count(int pos | xmlChars(_, _, this, pos, _, _)) }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Internal.
|
||||
*
|
||||
* Append the character sequences of this XML parent from left to right, separated by a space,
|
||||
* up to a specified (zero-based) index.
|
||||
*/
|
||||
deprecated string charsSetUpTo(int n) {
|
||||
n = 0 and xmlChars(_, result, this, 0, _, _)
|
||||
or
|
||||
n > 0 and
|
||||
exists(string chars | xmlChars(_, chars, this, n, _, _) |
|
||||
result = this.charsSetUpTo(n - 1) + " " + chars
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the result of appending all the character sequences of this XML parent from
|
||||
* left to right, separated by a space.
|
||||
|
||||
Reference in New Issue
Block a user