Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++: Replace the stats file by an empty file #18411

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cpp/ql/lib/semmle/code/cpp/Parameter.qll
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ class Parameter extends LocalScopeVariable, @parameter {
private VariableDeclarationEntry getAnEffectiveDeclarationEntry() {
if this.getFunction().isConstructedFrom(_)
then
exists(Function prototypeInstantiation |
prototypeInstantiation.getParameter(this.getIndex()) = result.getVariable() and
exists(Function prototypeInstantiation, int i | pragma[only_bind_into](i) = this.getIndex() |
prototypeInstantiation.getParameter(pragma[only_bind_into](i)) = result.getVariable() and
this.getFunction().isConstructedFrom(prototypeInstantiation)
)
else result = this.getADeclarationEntry()
Expand Down
4 changes: 2 additions & 2 deletions cpp/ql/lib/semmle/code/cpp/exprs/Expr.qll
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ class Expr extends StmtParent, @expr {
if exists(this.getDbValueText())
then result = this.getDbValueText()
else
exists(Expr e |
exists(Expr e, string v | pragma[only_bind_into](v) = this.getValue() |
e = this.getConversion() and
e.getValue() = this.getValue() and
e.getValue() = pragma[only_bind_into](v) and
result = e.getValueTextFollowingConversions()
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,12 @@ MemoryLocation getResultMemoryLocation(Instruction instr) {
// And otherwise we assign it a memory location that groups all the relevant memory locations into one.
result = getGroupedMemoryLocation(var, unbindBool(isMayAccess), false)
)
else result = TUnknownMemoryLocation(instr.getEnclosingIRFunction(), isMayAccess)
else
exists(IRFunction f |
pragma[only_bind_into](f) = pragma[only_bind_into](instr).getEnclosingIRFunction()
|
result = TUnknownMemoryLocation(f, isMayAccess)
)
)
or
kind instanceof EntireAllocationMemoryAccess and
Expand All @@ -935,10 +940,18 @@ MemoryLocation getResultMemoryLocation(Instruction instr) {
unbindBool(isMayAccess))
or
kind instanceof EscapedMemoryAccess and
result = TAllAliasedMemory(instr.getEnclosingIRFunction(), isMayAccess)
exists(IRFunction f |
pragma[only_bind_into](f) = pragma[only_bind_into](instr).getEnclosingIRFunction()
|
result = TAllAliasedMemory(f, isMayAccess)
)
or
kind instanceof NonLocalMemoryAccess and
result = TAllNonLocalMemory(instr.getEnclosingIRFunction(), isMayAccess)
exists(IRFunction f |
pragma[only_bind_into](f) = pragma[only_bind_into](instr).getEnclosingIRFunction()
|
result = TAllNonLocalMemory(f, isMayAccess)
)
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ private predicate hasDefaultSideEffect(Call call, ParameterIndex i, boolean buff
) and
(
isWrite = true and
not isConstPointerLike(call.getTarget().getParameter(i).getUnderlyingType())
exists(Function f | pragma[only_bind_into](f) = pragma[only_bind_into](call).getTarget() |
not isConstPointerLike(f.getParameter(i).getUnderlyingType())
)
or
isWrite = false
)
Expand Down
Loading
Loading