C++: add comments in new iterator models

This commit is contained in:
Robert Marsh
2020-10-14 13:13:16 -07:00
parent a1a441d759
commit fbe9bc8587
2 changed files with 11 additions and 0 deletions

View File

@@ -338,6 +338,10 @@ class BeginOrEndFunction extends MemberFunction, TaintFunction, GetIteratorFunct
}
}
/**
* The `std::front_inserter`, `std::inserter`, and `std::back_inserter`
* functions.
*/
class InserterIteratorFunction extends GetIteratorFunction {
InserterIteratorFunction() {
this.hasName(["front_inserter", "inserter", "back_inserter"]) and

View File

@@ -16,6 +16,13 @@ import semmle.code.cpp.models.Models
*/
abstract class IteratorReferenceFunction extends Function { }
/**
* A function which takes a container and returns an iterator over that container.
*/
abstract class GetIteratorFunction extends Function {
/**
* Holds if the return value or buffer represented by `output` is an iterator over the container
* passd in the argument, qualifier, or buffer represented by `input`.
*/
abstract predicate getsIterator(FunctionInput input, FunctionOutput output);
}