@@ -89,11 +89,8 @@ private class StdSequenceContainerConstructor extends Constructor, TaintFunction
8989 */
9090private class StdSequenceContainerData extends TaintFunction {
9191 StdSequenceContainerData ( ) {
92- this .hasName ( "data" ) and
93- (
94- this .getDeclaringType ( ) instanceof Vector or
95- this .getDeclaringType ( ) instanceof Array
96- )
92+ this .getClassAndName ( "data" ) instanceof Array or
93+ this .getClassAndName ( "data" ) instanceof Vector
9794 }
9895
9996 override predicate hasTaintFlow ( FunctionInput input , FunctionOutput output ) {
@@ -113,19 +110,10 @@ private class StdSequenceContainerData extends TaintFunction {
113110 */
114111private class StdSequenceContainerPush extends TaintFunction {
115112 StdSequenceContainerPush ( ) {
116- this .hasName ( "push_back" ) and
117- (
118- this .getDeclaringType ( ) instanceof Array or
119- this .getDeclaringType ( ) instanceof Deque or
120- this .getDeclaringType ( ) instanceof List
121- )
122- or
123- this .hasName ( "push_front" ) and
124- (
125- this .getDeclaringType ( ) instanceof Deque or
126- this .getDeclaringType ( ) instanceof ForwardList or
127- this .getDeclaringType ( ) instanceof List
128- )
113+ this .getClassAndName ( "push_back" ) instanceof Array or
114+ this .getClassAndName ( [ "push_back" , "push_front" ] ) instanceof Deque or
115+ this .getClassAndName ( "push_front" ) instanceof ForwardList or
116+ this .getClassAndName ( "push_back" ) instanceof List or
129117 }
130118
131119 override predicate hasTaintFlow ( FunctionInput input , FunctionOutput output ) {
@@ -140,22 +128,11 @@ private class StdSequenceContainerPush extends TaintFunction {
140128 */
141129private class StdSequenceContainerFrontBack extends TaintFunction {
142130 StdSequenceContainerFrontBack ( ) {
143- this .hasName ( "front" ) and
144- (
145- this .getDeclaringType ( ) instanceof Array or
146- this .getDeclaringType ( ) instanceof Deque or
147- this .getDeclaringType ( ) instanceof ForwardList or
148- this .getDeclaringType ( ) instanceof List or
149- this .getDeclaringType ( ) instanceof Vector
150- )
151- or
152- this .hasName ( "back" ) and
153- (
154- this .getDeclaringType ( ) instanceof Array or
155- this .getDeclaringType ( ) instanceof Deque or
156- this .getDeclaringType ( ) instanceof List or
157- this .getDeclaringType ( ) instanceof Vector
158- )
131+ this .getClassAndName ( [ "front" , "back" ] ) instanceof Array or
132+ this .getClassAndName ( [ "front" , "back" ] ) instanceof Deque or
133+ this .getClassAndName ( "front" ) instanceof ForwardList or
134+ this .getClassAndName ( [ "front" , "back" ] ) instanceof List or
135+ this .getClassAndName ( [ "front" , "back" ] ) instanceof Vector
159136 }
160137
161138 override predicate hasTaintFlow ( FunctionInput input , FunctionOutput output ) {
@@ -170,15 +147,10 @@ private class StdSequenceContainerFrontBack extends TaintFunction {
170147 */
171148private class StdSequenceContainerInsert extends TaintFunction {
172149 StdSequenceContainerInsert ( ) {
173- this .hasName ( "insert" ) and
174- (
175- this .getDeclaringType ( ) instanceof Deque or
176- this .getDeclaringType ( ) instanceof List or
177- this .getDeclaringType ( ) instanceof Vector
178- )
179- or
180- this .hasName ( "insert_after" ) and
181- this .getDeclaringType ( ) instanceof ForwardList
150+ this .getClassAndName ( "insert" ) instanceof Deque or
151+ this .getClassAndName ( "insert" ) instanceof List or
152+ this .getClassAndName ( "insert" ) instanceof Vector or
153+ this .getClassAndName ( "insert_after" ) instanceof ForwardList
182154 }
183155
184156 /**
@@ -214,13 +186,10 @@ private class StdSequenceContainerInsert extends TaintFunction {
214186 */
215187private class StdSequenceContainerAssign extends TaintFunction {
216188 StdSequenceContainerAssign ( ) {
217- this .hasName ( "assign" ) and
218- (
219- this .getDeclaringType ( ) instanceof Deque or
220- this .getDeclaringType ( ) instanceof ForwardList or
221- this .getDeclaringType ( ) instanceof List or
222- this .getDeclaringType ( ) instanceof Vector
223- )
189+ this .getClassAndName ( "assign" ) instanceof Deque or
190+ this .getClassAndName ( "assign" ) instanceof ForwardList or
191+ this .getClassAndName ( "assign" ) instanceof List or
192+ this .getClassAndName ( "assign" ) instanceof Vector
224193 }
225194
226195 /**
@@ -252,12 +221,9 @@ private class StdSequenceContainerAssign extends TaintFunction {
252221 */
253222private class StdSequenceContainerAt extends TaintFunction {
254223 StdSequenceContainerAt ( ) {
255- this .hasName ( [ "at" , "operator[]" ] ) and
256- (
257- this .getDeclaringType ( ) instanceof Array or
258- this .getDeclaringType ( ) instanceof Deque or
259- this .getDeclaringType ( ) instanceof Vector
260- )
224+ this .getClassAndName ( [ "at" , "operator[]" ] ) instanceof Array or
225+ this .getClassAndName ( [ "at" , "operator[]" ] ) instanceof Deque or
226+ this .getClassAndName ( [ "at" , "operator[]" ] ) instanceof Vector
261227 }
262228
263229 override predicate hasTaintFlow ( FunctionInput input , FunctionOutput output ) {
@@ -275,10 +241,7 @@ private class StdSequenceContainerAt extends TaintFunction {
275241 * The standard vector `emplace` function.
276242 */
277243class StdVectorEmplace extends TaintFunction {
278- StdVectorEmplace ( ) {
279- this .hasName ( "emplace" ) and
280- this .getDeclaringType ( ) instanceof Vector
281- }
244+ StdVectorEmplace ( ) { this .getClassAndName ( "emplace" ) instanceof Vector }
282245
283246 override predicate hasTaintFlow ( FunctionInput input , FunctionOutput output ) {
284247 // flow from any parameter except the position iterator to qualifier and return value
@@ -295,10 +258,7 @@ class StdVectorEmplace extends TaintFunction {
295258 * The standard vector `emplace_back` function.
296259 */
297260class StdVectorEmplaceBack extends TaintFunction {
298- StdVectorEmplaceBack ( ) {
299- this .hasName ( "emplace_back" ) and
300- this .getDeclaringType ( ) instanceof Vector
301- }
261+ StdVectorEmplaceBack ( ) { this .getClassAndName ( "emplace_back" ) instanceof Vector }
302262
303263 override predicate hasTaintFlow ( FunctionInput input , FunctionOutput output ) {
304264 // flow from any parameter to qualifier
0 commit comments