mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Merge rc/1.18 into next.
This commit is contained in:
@@ -62,8 +62,14 @@ predicate verifiedRealloc(FunctionCall reallocCall, Variable v, ControlFlowNode
|
||||
// a realloc followed by a null check at 'node' (return the non-null
|
||||
// successor, i.e. where the realloc is confirmed to have succeeded)
|
||||
newV.getAnAssignedValue() = reallocCall and
|
||||
node.(AnalysedExpr).getNonNullSuccessor(newV) = verified
|
||||
node.(AnalysedExpr).getNonNullSuccessor(newV) = verified and
|
||||
// note: this case uses naive flow logic (getAnAssignedValue).
|
||||
|
||||
// special case: if the result of the 'realloc' is assigned to the
|
||||
// same variable, we don't descriminate properly between the old
|
||||
// and the new allocation; better to not consider this a free at
|
||||
// all in that case.
|
||||
newV != v
|
||||
) or (
|
||||
// a realloc(ptr, 0), which always succeeds and frees
|
||||
// (return the realloc itself)
|
||||
|
||||
@@ -566,7 +566,7 @@ class Class extends UserType {
|
||||
* The alignment of this type in bytes (on the machine where facts were
|
||||
* extracted).
|
||||
*/
|
||||
int getAlignment() { usertypesize(underlyingElement(this),_,result) }
|
||||
override int getAlignment() { usertypesize(underlyingElement(this),_,result) }
|
||||
|
||||
/**
|
||||
* Holds if this class is constructed from another class as a result of
|
||||
|
||||
@@ -162,7 +162,7 @@ abstract class Container extends Locatable, @container {
|
||||
*
|
||||
* This is the absolute path of the container.
|
||||
*/
|
||||
string toString() {
|
||||
override string toString() {
|
||||
result = getAbsolutePath()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,15 +43,28 @@ private cached module Cached {
|
||||
(not successors_extended(_, node) and successors_extended(node, _))
|
||||
}
|
||||
|
||||
/** Holds if `n2` follows `n1` in a `PrimitiveBasicBlock`. */
|
||||
private predicate member_step(Node n1, Node n2) {
|
||||
successors_extended(n1, n2) and
|
||||
not n2 instanceof PrimitiveBasicBlock
|
||||
}
|
||||
|
||||
/** Returns the index of `node` in its `PrimitiveBasicBlock`. */
|
||||
private int getMemberIndex(Node node) {
|
||||
primitive_basic_block_entry_node(node) and
|
||||
result = 0
|
||||
or
|
||||
exists(Node prev |
|
||||
member_step(prev, node) and
|
||||
result = getMemberIndex(prev) + 1
|
||||
)
|
||||
}
|
||||
|
||||
/** Holds if `node` is the `pos`th control-flow node in primitive basic block `bb`. */
|
||||
cached
|
||||
predicate primitive_basic_block_member(Node node, PrimitiveBasicBlock bb, int pos) {
|
||||
(node = bb and pos = 0)
|
||||
or
|
||||
(not (node instanceof PrimitiveBasicBlock) and
|
||||
exists (Node pred
|
||||
| successors_extended(pred, node)
|
||||
| primitive_basic_block_member(pred, bb, pos - 1)))
|
||||
pos = getMemberIndex(node) and
|
||||
member_step*(bb, node)
|
||||
}
|
||||
|
||||
/** Gets the number of control-flow nodes in the primitive basic block `bb`. */
|
||||
|
||||
@@ -128,6 +128,7 @@ predicate readStep(Node node1, Content f, Node node2) {
|
||||
* numeric conversions, and otherwise the erasure is used.
|
||||
*/
|
||||
RefType getErasedRepr(Type t) {
|
||||
suppressUnusedType(t) and
|
||||
result instanceof VoidType // stub implementation
|
||||
}
|
||||
|
||||
@@ -140,6 +141,8 @@ predicate compatibleTypes(Type t1, Type t2) {
|
||||
any() // stub implementation
|
||||
}
|
||||
|
||||
private predicate suppressUnusedType(Type t) { any() }
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Java QL library compatibility wrappers
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
import internal.IRImpl
|
||||
// Most queries should operate on the aliased SSA IR, so that's what we expose
|
||||
// publically as the "IR".
|
||||
import implementation.aliased_ssa.IR
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
* @id cpp/ir-sanity-check
|
||||
*/
|
||||
|
||||
import internal.IRSanityImpl
|
||||
import implementation.aliased_ssa.IRSanity
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
import internal.Opcode
|
||||
@@ -5,4 +5,4 @@
|
||||
* @kind graph
|
||||
*/
|
||||
|
||||
import PrintIR
|
||||
import implementation.aliased_ssa.PrintIR
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
import internal.PrintIRImpl
|
||||
@@ -1,5 +1,5 @@
|
||||
import cpp
|
||||
private import internal.TempVariableTag
|
||||
private import semmle.code.cpp.ir.internal.TempVariableTag
|
||||
|
||||
class TempVariableTag extends TTempVariableTag {
|
||||
string toString() {
|
||||
@@ -1,4 +1,4 @@
|
||||
private import IRInternal
|
||||
private import internal.IRInternal
|
||||
import Instruction
|
||||
import cpp
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import FunctionIR
|
||||
import Instruction
|
||||
import IRBlock
|
||||
import IRVariable
|
||||
import OperandTag
|
||||
import semmle.code.cpp.ir.implementation.EdgeKind
|
||||
import semmle.code.cpp.ir.implementation.MemoryAccessKind
|
||||
@@ -1,7 +1,7 @@
|
||||
private import IRInternal
|
||||
private import IRBlockConstruction
|
||||
private import internal.IRInternal
|
||||
import Instruction
|
||||
import semmle.code.cpp.ir.EdgeKind
|
||||
import semmle.code.cpp.ir.implementation.EdgeKind
|
||||
private import Construction::BlockConstruction
|
||||
|
||||
class IRBlock extends TIRBlock {
|
||||
final string toString() {
|
||||
@@ -5,4 +5,4 @@
|
||||
* @id cpp/aliased-ssa-ir-sanity-check
|
||||
*/
|
||||
|
||||
import internal.aliased_ssa.IRSanityImpl
|
||||
import IRSanity
|
||||
@@ -1,3 +1,3 @@
|
||||
private import IRImpl
|
||||
private import IR
|
||||
import InstructionSanity
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
private import IRInternal
|
||||
private import internal.IRInternal
|
||||
import FunctionIR
|
||||
import cpp
|
||||
import semmle.code.cpp.ir.TempVariableTag
|
||||
import semmle.code.cpp.ir.implementation.TempVariableTag
|
||||
private import semmle.code.cpp.ir.internal.TempVariableTag
|
||||
|
||||
private newtype TIRVariable =
|
||||
@@ -1,13 +1,13 @@
|
||||
private import IRInternal
|
||||
private import internal.IRInternal
|
||||
import FunctionIR
|
||||
import IRBlock
|
||||
import IRVariable
|
||||
import OperandTag
|
||||
import cpp
|
||||
import semmle.code.cpp.ir.EdgeKind
|
||||
import semmle.code.cpp.ir.MemoryAccessKind
|
||||
import semmle.code.cpp.ir.Opcode
|
||||
private import semmle.code.cpp.ir.internal.Opcode
|
||||
import semmle.code.cpp.ir.implementation.EdgeKind
|
||||
import semmle.code.cpp.ir.implementation.MemoryAccessKind
|
||||
import semmle.code.cpp.ir.implementation.Opcode
|
||||
private import semmle.code.cpp.ir.implementation.Opcode
|
||||
|
||||
class InstructionTag = Construction::InstructionTagType;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
private import IRInternal
|
||||
private import internal.IRInternal
|
||||
import Instruction
|
||||
import IRBlock
|
||||
import cpp
|
||||
@@ -5,4 +5,4 @@
|
||||
* @kind graph
|
||||
*/
|
||||
|
||||
import PrintAliasedSSAIR
|
||||
import PrintIR
|
||||
@@ -1,4 +1,4 @@
|
||||
private import IRImpl
|
||||
private import IR
|
||||
import cpp
|
||||
|
||||
private newtype TPrintableIRNode =
|
||||
@@ -83,7 +83,7 @@ class PrintableFunctionIR extends PrintableIRNode, TPrintableFunctionIR {
|
||||
override int getOrder() {
|
||||
this = rank[result + 1](PrintableFunctionIR orderedFunc, Location location |
|
||||
location = orderedFunc.getFunctionIR().getLocation() |
|
||||
orderedFunc order by location.getFile().getURL(), location.getStartLine(),
|
||||
orderedFunc order by location.getFile().getAbsolutePath(), location.getStartLine(),
|
||||
location.getStartColumn(), orderedFunc.getLabel()
|
||||
)
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
private import AliasAnalysisInternal
|
||||
import cpp
|
||||
private import IR
|
||||
private import semmle.code.cpp.ssa.internal.IntegerConstant as Ints
|
||||
private import InputIR
|
||||
private import semmle.code.cpp.ir.internal.IntegerConstant as Ints
|
||||
|
||||
private class IntValue = Ints::IntValue;
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
import semmle.code.cpp.ir.implementation.unaliased_ssa.IR as InputIR
|
||||
@@ -1,6 +1,6 @@
|
||||
private import IRInternal
|
||||
private import Construction::OldIR as OldIR
|
||||
import Instruction
|
||||
import SSAConstructionInternal
|
||||
private import SSAConstruction as Construction
|
||||
private import NewIR
|
||||
|
||||
import Cached
|
||||
private cached module Cached {
|
||||
@@ -1,7 +1,8 @@
|
||||
import SSAConstructionInternal
|
||||
import cpp
|
||||
private import semmle.code.cpp.ir.internal.Opcode
|
||||
private import semmle.code.cpp.ir.implementation.Opcode
|
||||
import NewIR
|
||||
import IRBlockConstruction as BlockConstruction
|
||||
|
||||
import Cached
|
||||
cached private module Cached {
|
||||
@@ -0,0 +1,3 @@
|
||||
import semmle.code.cpp.ir.implementation.unaliased_ssa.IR as OldIR
|
||||
import semmle.code.cpp.ir.implementation.aliased_ssa.IR as NewIR
|
||||
import SimpleSSA as Alias
|
||||
@@ -1,8 +1,8 @@
|
||||
import SimpleSSAInternal
|
||||
import cpp
|
||||
import Alias
|
||||
import IR
|
||||
import semmle.code.cpp.ssa.internal.Overlap
|
||||
private import InputIR
|
||||
import semmle.code.cpp.ir.internal.Overlap
|
||||
|
||||
private newtype TVirtualVariable =
|
||||
MkVirtualVariable(IRVariable var) {
|
||||
@@ -0,0 +1,3 @@
|
||||
import AliasAnalysis as Alias
|
||||
import semmle.code.cpp.ir.implementation.unaliased_ssa.IR as InputIR
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
private import IRInternal
|
||||
private import internal.IRInternal
|
||||
import Instruction
|
||||
import cpp
|
||||
|
||||
7
cpp/ql/src/semmle/code/cpp/ir/implementation/raw/IR.qll
Normal file
7
cpp/ql/src/semmle/code/cpp/ir/implementation/raw/IR.qll
Normal file
@@ -0,0 +1,7 @@
|
||||
import FunctionIR
|
||||
import Instruction
|
||||
import IRBlock
|
||||
import IRVariable
|
||||
import OperandTag
|
||||
import semmle.code.cpp.ir.implementation.EdgeKind
|
||||
import semmle.code.cpp.ir.implementation.MemoryAccessKind
|
||||
@@ -1,7 +1,7 @@
|
||||
private import IRInternal
|
||||
private import IRBlockConstruction
|
||||
private import internal.IRInternal
|
||||
import Instruction
|
||||
import semmle.code.cpp.ir.EdgeKind
|
||||
import semmle.code.cpp.ir.implementation.EdgeKind
|
||||
private import Construction::BlockConstruction
|
||||
|
||||
class IRBlock extends TIRBlock {
|
||||
final string toString() {
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* @name Raw IR Sanity Check
|
||||
* @description Performs sanity checks on the Intermediate Representation. This query should have no results.
|
||||
* @kind problem
|
||||
* @id cpp/raw-ir-sanity-check
|
||||
*/
|
||||
|
||||
import IRSanity
|
||||
@@ -1,3 +1,3 @@
|
||||
private import IRImpl
|
||||
private import IR
|
||||
import InstructionSanity
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
private import IRInternal
|
||||
private import internal.IRInternal
|
||||
import FunctionIR
|
||||
import cpp
|
||||
import semmle.code.cpp.ir.TempVariableTag
|
||||
import semmle.code.cpp.ir.implementation.TempVariableTag
|
||||
private import semmle.code.cpp.ir.internal.TempVariableTag
|
||||
|
||||
private newtype TIRVariable =
|
||||
@@ -1,13 +1,13 @@
|
||||
private import IRInternal
|
||||
private import internal.IRInternal
|
||||
import FunctionIR
|
||||
import IRBlock
|
||||
import IRVariable
|
||||
import OperandTag
|
||||
import cpp
|
||||
import semmle.code.cpp.ir.EdgeKind
|
||||
import semmle.code.cpp.ir.MemoryAccessKind
|
||||
import semmle.code.cpp.ir.Opcode
|
||||
private import semmle.code.cpp.ir.internal.Opcode
|
||||
import semmle.code.cpp.ir.implementation.EdgeKind
|
||||
import semmle.code.cpp.ir.implementation.MemoryAccessKind
|
||||
import semmle.code.cpp.ir.implementation.Opcode
|
||||
private import semmle.code.cpp.ir.implementation.Opcode
|
||||
|
||||
class InstructionTag = Construction::InstructionTagType;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
private import IRInternal
|
||||
private import internal.IRInternal
|
||||
import Instruction
|
||||
import IRBlock
|
||||
import cpp
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* @name Print Raw IR
|
||||
* @description Outputs a representation of the Raw IR graph
|
||||
* @id cpp/print-raw-ir
|
||||
* @kind graph
|
||||
*/
|
||||
|
||||
import PrintIR
|
||||
@@ -1,4 +1,4 @@
|
||||
private import IRImpl
|
||||
private import IR
|
||||
import cpp
|
||||
|
||||
private newtype TPrintableIRNode =
|
||||
@@ -83,7 +83,7 @@ class PrintableFunctionIR extends PrintableIRNode, TPrintableFunctionIR {
|
||||
override int getOrder() {
|
||||
this = rank[result + 1](PrintableFunctionIR orderedFunc, Location location |
|
||||
location = orderedFunc.getFunctionIR().getLocation() |
|
||||
orderedFunc order by location.getFile().getURL(), location.getStartLine(),
|
||||
orderedFunc order by location.getFile().getAbsolutePath(), location.getStartLine(),
|
||||
location.getStartColumn(), orderedFunc.getLabel()
|
||||
)
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
private import IRInternal
|
||||
import Instruction
|
||||
import semmle.code.cpp.ir.implementation.raw.Instruction
|
||||
import cpp
|
||||
import semmle.code.cpp.ir.EdgeKind
|
||||
import semmle.code.cpp.ir.implementation.EdgeKind
|
||||
|
||||
private predicate startsBasicBlock(Instruction instr) {
|
||||
not instr instanceof PhiInstruction and
|
||||
@@ -1,7 +1,8 @@
|
||||
import cpp
|
||||
import semmle.code.cpp.ir.IR
|
||||
import semmle.code.cpp.ir.implementation.raw.IR
|
||||
import IRBlockConstruction as BlockConstruction
|
||||
private import semmle.code.cpp.ir.internal.TempVariableTag
|
||||
private import InstructionTag
|
||||
private import TempVariableTag
|
||||
private import TranslatedElement
|
||||
private import TranslatedFunction
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import cpp
|
||||
private import semmle.code.cpp.ir.implementation.Opcode
|
||||
private import InstructionTag
|
||||
private import Opcode
|
||||
private import TranslatedElement
|
||||
private import TranslatedExpr
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import cpp
|
||||
private import semmle.code.cpp.ir.implementation.Opcode
|
||||
private import InstructionTag
|
||||
private import Opcode
|
||||
private import TranslatedElement
|
||||
private import TranslatedExpr
|
||||
private import TranslatedInitialization
|
||||
@@ -1,8 +1,8 @@
|
||||
import cpp
|
||||
import semmle.code.cpp.ir.IR
|
||||
import semmle.code.cpp.ir.implementation.raw.IR
|
||||
private import semmle.code.cpp.ir.implementation.Opcode
|
||||
private import semmle.code.cpp.ir.internal.TempVariableTag
|
||||
private import InstructionTag
|
||||
private import Opcode
|
||||
private import TempVariableTag
|
||||
private import TranslatedCondition
|
||||
private import TranslatedFunction
|
||||
private import TranslatedStmt
|
||||
@@ -1,7 +1,7 @@
|
||||
import cpp
|
||||
private import semmle.code.cpp.ir.implementation.Opcode
|
||||
private import semmle.code.cpp.ir.internal.TempVariableTag
|
||||
private import InstructionTag
|
||||
private import Opcode
|
||||
private import TempVariableTag
|
||||
private import TranslatedCondition
|
||||
private import TranslatedElement
|
||||
private import TranslatedFunction
|
||||
@@ -1,8 +1,8 @@
|
||||
import cpp
|
||||
import semmle.code.cpp.ir.IR
|
||||
import semmle.code.cpp.ir.implementation.raw.IR
|
||||
private import semmle.code.cpp.ir.implementation.Opcode
|
||||
private import semmle.code.cpp.ir.internal.TempVariableTag
|
||||
private import InstructionTag
|
||||
private import Opcode
|
||||
private import TempVariableTag
|
||||
private import TranslatedElement
|
||||
private import TranslatedExpr
|
||||
private import TranslatedInitialization
|
||||
@@ -1,6 +1,6 @@
|
||||
import cpp
|
||||
private import semmle.code.cpp.ir.implementation.Opcode
|
||||
private import InstructionTag
|
||||
private import Opcode
|
||||
private import TranslatedElement
|
||||
private import TranslatedExpr
|
||||
private import TranslatedFunction
|
||||
@@ -1,6 +1,6 @@
|
||||
import cpp
|
||||
private import semmle.code.cpp.ir.internal.TempVariableTag
|
||||
private import InstructionTag
|
||||
private import Opcode
|
||||
private import TranslatedCondition
|
||||
private import TranslatedDeclarationEntry
|
||||
private import TranslatedElement
|
||||
@@ -1,4 +1,4 @@
|
||||
private import IRInternal
|
||||
private import internal.IRInternal
|
||||
import Instruction
|
||||
import cpp
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import FunctionIR
|
||||
import Instruction
|
||||
import IRBlock
|
||||
import IRVariable
|
||||
import OperandTag
|
||||
import semmle.code.cpp.ir.implementation.EdgeKind
|
||||
import semmle.code.cpp.ir.implementation.MemoryAccessKind
|
||||
@@ -1,7 +1,7 @@
|
||||
private import IRInternal
|
||||
private import IRBlockConstruction
|
||||
private import internal.IRInternal
|
||||
import Instruction
|
||||
import semmle.code.cpp.ir.EdgeKind
|
||||
import semmle.code.cpp.ir.implementation.EdgeKind
|
||||
private import Construction::BlockConstruction
|
||||
|
||||
class IRBlock extends TIRBlock {
|
||||
final string toString() {
|
||||
@@ -5,4 +5,4 @@
|
||||
* @id cpp/ssa-ir-sanity-check
|
||||
*/
|
||||
|
||||
import internal.ssa.IRSanityImpl
|
||||
import IRSanity
|
||||
@@ -1,3 +1,3 @@
|
||||
private import IRImpl
|
||||
private import IR
|
||||
import InstructionSanity
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
private import IRInternal
|
||||
private import internal.IRInternal
|
||||
import FunctionIR
|
||||
import cpp
|
||||
import semmle.code.cpp.ir.TempVariableTag
|
||||
import semmle.code.cpp.ir.implementation.TempVariableTag
|
||||
private import semmle.code.cpp.ir.internal.TempVariableTag
|
||||
|
||||
private newtype TIRVariable =
|
||||
@@ -1,13 +1,13 @@
|
||||
private import IRInternal
|
||||
private import internal.IRInternal
|
||||
import FunctionIR
|
||||
import IRBlock
|
||||
import IRVariable
|
||||
import OperandTag
|
||||
import cpp
|
||||
import semmle.code.cpp.ir.EdgeKind
|
||||
import semmle.code.cpp.ir.MemoryAccessKind
|
||||
import semmle.code.cpp.ir.Opcode
|
||||
private import semmle.code.cpp.ir.internal.Opcode
|
||||
import semmle.code.cpp.ir.implementation.EdgeKind
|
||||
import semmle.code.cpp.ir.implementation.MemoryAccessKind
|
||||
import semmle.code.cpp.ir.implementation.Opcode
|
||||
private import semmle.code.cpp.ir.implementation.Opcode
|
||||
|
||||
class InstructionTag = Construction::InstructionTagType;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
private import IRInternal
|
||||
private import internal.IRInternal
|
||||
import Instruction
|
||||
import IRBlock
|
||||
import cpp
|
||||
@@ -5,4 +5,4 @@
|
||||
* @kind graph
|
||||
*/
|
||||
|
||||
import PrintSSAIR
|
||||
import PrintIR
|
||||
@@ -1,4 +1,4 @@
|
||||
private import IRImpl
|
||||
private import IR
|
||||
import cpp
|
||||
|
||||
private newtype TPrintableIRNode =
|
||||
@@ -83,7 +83,7 @@ class PrintableFunctionIR extends PrintableIRNode, TPrintableFunctionIR {
|
||||
override int getOrder() {
|
||||
this = rank[result + 1](PrintableFunctionIR orderedFunc, Location location |
|
||||
location = orderedFunc.getFunctionIR().getLocation() |
|
||||
orderedFunc order by location.getFile().getURL(), location.getStartLine(),
|
||||
orderedFunc order by location.getFile().getAbsolutePath(), location.getStartLine(),
|
||||
location.getStartColumn(), orderedFunc.getLabel()
|
||||
)
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
private import AliasAnalysisInternal
|
||||
import cpp
|
||||
private import IR
|
||||
private import semmle.code.cpp.ssa.internal.IntegerConstant as Ints
|
||||
private import InputIR
|
||||
private import semmle.code.cpp.ir.internal.IntegerConstant as Ints
|
||||
|
||||
private class IntValue = Ints::IntValue;
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
import semmle.code.cpp.ir.implementation.raw.IR as InputIR
|
||||
@@ -1,6 +1,6 @@
|
||||
private import IRInternal
|
||||
private import Construction::OldIR as OldIR
|
||||
import Instruction
|
||||
import SSAConstructionInternal
|
||||
private import SSAConstruction as Construction
|
||||
private import NewIR
|
||||
|
||||
import Cached
|
||||
private cached module Cached {
|
||||
@@ -1,7 +1,8 @@
|
||||
import SSAConstructionInternal
|
||||
import cpp
|
||||
private import semmle.code.cpp.ir.internal.Opcode
|
||||
private import semmle.code.cpp.ir.implementation.Opcode
|
||||
import NewIR
|
||||
import IRBlockConstruction as BlockConstruction
|
||||
|
||||
import Cached
|
||||
cached private module Cached {
|
||||
@@ -0,0 +1,3 @@
|
||||
import semmle.code.cpp.ir.implementation.raw.IR as OldIR
|
||||
import semmle.code.cpp.ir.implementation.unaliased_ssa.IR as NewIR
|
||||
import SimpleSSA as Alias
|
||||
@@ -1,8 +1,8 @@
|
||||
import SimpleSSAInternal
|
||||
import cpp
|
||||
import Alias
|
||||
import IR
|
||||
import semmle.code.cpp.ssa.internal.Overlap
|
||||
private import InputIR
|
||||
import semmle.code.cpp.ir.internal.Overlap
|
||||
|
||||
private newtype TVirtualVariable =
|
||||
MkVirtualVariable(IRVariable var) {
|
||||
@@ -0,0 +1,2 @@
|
||||
import AliasAnalysis as Alias
|
||||
import semmle.code.cpp.ir.implementation.raw.IR as InputIR
|
||||
@@ -1,7 +0,0 @@
|
||||
import FunctionIR
|
||||
import Instruction
|
||||
import IRBlock
|
||||
import IRVariable
|
||||
import OperandTag
|
||||
import semmle.code.cpp.ir.EdgeKind
|
||||
import semmle.code.cpp.ir.MemoryAccessKind
|
||||
@@ -1 +0,0 @@
|
||||
import internal.aliased_ssa.IRImpl
|
||||
@@ -1 +0,0 @@
|
||||
import internal.aliased_ssa.PrintIRImpl
|
||||
@@ -1 +0,0 @@
|
||||
import internal.ssa.PrintIRImpl
|
||||
@@ -1 +0,0 @@
|
||||
import internal.ssa.IRImpl
|
||||
@@ -1 +0,0 @@
|
||||
import semmle.code.cpp.ssa.SSAIR as IR
|
||||
@@ -1,7 +0,0 @@
|
||||
import FunctionIR
|
||||
import Instruction
|
||||
import IRBlock
|
||||
import IRVariable
|
||||
import OperandTag
|
||||
import semmle.code.cpp.ir.EdgeKind
|
||||
import semmle.code.cpp.ir.MemoryAccessKind
|
||||
@@ -1,3 +0,0 @@
|
||||
import semmle.code.cpp.ssa.SSAIR as OldIR
|
||||
import semmle.code.cpp.ssa.AliasedSSAIR as NewIR
|
||||
import SimpleSSA as Alias
|
||||
@@ -1,3 +0,0 @@
|
||||
import AliasAnalysis as Alias
|
||||
import semmle.code.cpp.ssa.SSAIR as IR
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
import semmle.code.cpp.ir.IR as IR
|
||||
@@ -1,7 +0,0 @@
|
||||
import FunctionIR
|
||||
import Instruction
|
||||
import IRBlock
|
||||
import IRVariable
|
||||
import OperandTag
|
||||
import semmle.code.cpp.ir.EdgeKind
|
||||
import semmle.code.cpp.ir.MemoryAccessKind
|
||||
@@ -1,3 +0,0 @@
|
||||
import semmle.code.cpp.ir.IR as OldIR
|
||||
import semmle.code.cpp.ssa.SSAIR as NewIR
|
||||
import SimpleSSA as Alias
|
||||
@@ -1,3 +0,0 @@
|
||||
import AliasAnalysis as Alias
|
||||
import semmle.code.cpp.ir.IR as IR
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import default
|
||||
import semmle.code.cpp.ssa.SSAIR
|
||||
import semmle.code.cpp.ssa.internal.IntegerConstant
|
||||
import semmle.code.cpp.ir.IR
|
||||
import semmle.code.cpp.ir.internal.IntegerConstant
|
||||
|
||||
language[monotonicAggregates]
|
||||
IntValue getConstantValue(Instruction instr) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import cpp
|
||||
import semmle.code.cpp.ssa.internal.IntegerConstant as Ints
|
||||
import semmle.code.cpp.ir.internal.IntegerConstant as Ints
|
||||
|
||||
bindingset[n]
|
||||
string resultString(int n) {
|
||||
@@ -1,6 +1,6 @@
|
||||
import default
|
||||
import semmle.code.cpp.ssa.internal.ssa.AliasAnalysis
|
||||
import semmle.code.cpp.ir.IR
|
||||
import semmle.code.cpp.ir.implementation.unaliased_ssa.internal.AliasAnalysis
|
||||
import semmle.code.cpp.ir.implementation.raw.IR
|
||||
|
||||
predicate shouldEscape(IRAutomaticUserVariable var) {
|
||||
exists(string name |
|
||||
@@ -1,6 +1,6 @@
|
||||
import default
|
||||
import semmle.code.cpp.ssa.internal.ssa.AliasAnalysis
|
||||
import semmle.code.cpp.ir.IR
|
||||
import semmle.code.cpp.ir.implementation.unaliased_ssa.internal.AliasAnalysis
|
||||
import semmle.code.cpp.ir.implementation.raw.IR
|
||||
|
||||
from Instruction instr, string pointsTo
|
||||
where
|
||||
@@ -1,6 +1,6 @@
|
||||
import default
|
||||
import semmle.code.cpp.ssa.internal.aliased_ssa.AliasAnalysis
|
||||
import semmle.code.cpp.ssa.SSAIR
|
||||
import semmle.code.cpp.ir.implementation.aliased_ssa.internal.AliasAnalysis
|
||||
import semmle.code.cpp.ir.implementation.unaliased_ssa.IR
|
||||
|
||||
predicate shouldEscape(IRAutomaticUserVariable var) {
|
||||
exists(string name |
|
||||
@@ -1 +0,0 @@
|
||||
semmle/code/cpp/ssa/AliasedSSAIRSanity.ql
|
||||
@@ -1 +0,0 @@
|
||||
semmle/code/cpp/ssa/SSAIRSanity.ql
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user