mirror of
https://github.com/github/codeql.git
synced 2026-04-30 03:05:15 +02:00
Apply suggestions from code review
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
import cpp
|
||||
import semmle.code.cpp.valuenumbering.GlobalValueNumbering
|
||||
|
||||
/ ** Pridekat allows you to get the number of the argument used for positioning in the buffer by the name of the function. * /
|
||||
/** Holds for a function `f` that has an argument at index `apos` used for positioning in a buffer. */
|
||||
predicate numberArgument(Function f, int apos) {
|
||||
f.hasGlobalOrStdName("write") and apos = 2
|
||||
or
|
||||
@@ -54,7 +54,7 @@ class IfCompareWithZero extends IfStmt {
|
||||
|
||||
from FunctionCall fc, IfCompareWithZero ifc, int na
|
||||
where
|
||||
numberArgument(fc.getTarget(), na)
|
||||
numberArgument(fc.getTarget(), na) and
|
||||
globalValueNumber(fc.getArgument(na)) = globalValueNumber(ifc.noZerroOperand()) and
|
||||
dominates(fc, ifc) and
|
||||
not exists(IfStmt ifc1 |
|
||||
|
||||
Reference in New Issue
Block a user