mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
C++: add sanity test for side effect primaries
This commit is contained in:
@@ -120,6 +120,13 @@ module InstructionSanity {
|
||||
)
|
||||
}
|
||||
|
||||
query predicate sideEffectWithoutPrimary(SideEffectInstruction instr, string message, IRFunction func, string funcText) {
|
||||
not exists(instr.getPrimaryInstruction()) and
|
||||
message = "Side effect instruction missing primary instruction in function $@" and
|
||||
func = instr.getEnclosingIRFunction() and
|
||||
funcText = Language::getIdentityString(func.getFunction())
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if an instruction, other than `ExitFunction`, has no successors.
|
||||
*/
|
||||
|
||||
@@ -120,6 +120,13 @@ module InstructionSanity {
|
||||
)
|
||||
}
|
||||
|
||||
query predicate sideEffectWithoutPrimary(SideEffectInstruction instr, string message, IRFunction func, string funcText) {
|
||||
not exists(instr.getPrimaryInstruction()) and
|
||||
message = "Side effect instruction missing primary instruction in function $@" and
|
||||
func = instr.getEnclosingIRFunction() and
|
||||
funcText = Language::getIdentityString(func.getFunction())
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if an instruction, other than `ExitFunction`, has no successors.
|
||||
*/
|
||||
|
||||
@@ -120,6 +120,13 @@ module InstructionSanity {
|
||||
)
|
||||
}
|
||||
|
||||
query predicate sideEffectWithoutPrimary(SideEffectInstruction instr, string message, IRFunction func, string funcText) {
|
||||
not exists(instr.getPrimaryInstruction()) and
|
||||
message = "Side effect instruction missing primary instruction in function $@" and
|
||||
func = instr.getEnclosingIRFunction() and
|
||||
funcText = Language::getIdentityString(func.getFunction())
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if an instruction, other than `ExitFunction`, has no successors.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user