C++: Address review comments.

This commit is contained in:
Mathias Vorreiter Pedersen
2021-02-19 20:24:02 +01:00
parent fef824c37a
commit 576a872316
2 changed files with 6 additions and 6 deletions

View File

@@ -19,9 +19,9 @@ private class Accept extends ArrayFunction, AliasFunction, TaintFunction, SideEf
bufParam = 1 and countParam = 2
}
override predicate hasArrayInput(int bufParam) { bufParam = [1, 2] }
override predicate hasArrayInput(int bufParam) { bufParam = 1 }
override predicate hasArrayOutput(int bufParam) { bufParam = [1, 2] }
override predicate hasArrayOutput(int bufParam) { bufParam = 1 }
override predicate parameterNeverEscapes(int index) { exists(this.getParameter(index)) }

View File

@@ -19,9 +19,7 @@ private class Poll extends ArrayFunction, AliasFunction, TaintFunction, SideEffe
bufParam = 0 and countParam = 1
}
override predicate hasArrayInput(int bufParam) {
getParameter(bufParam).getUnspecifiedType() instanceof PointerType
}
override predicate hasArrayInput(int bufParam) { bufParam = 0 }
override predicate hasArrayOutput(int bufParam) { bufParam = 0 }
@@ -41,7 +39,9 @@ private class Poll extends ArrayFunction, AliasFunction, TaintFunction, SideEffe
}
override predicate hasSpecificReadSideEffect(ParameterIndex i, boolean buffer) {
getParameter(i).getUnspecifiedType() instanceof PointerType and buffer = true
i = 0 and buffer = true
or
this.hasGlobalName("ppoll") and i = [2, 3] and buffer = false
}
override predicate hasOnlySpecificReadSideEffects() { any() }