File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
cpp/ql/src/semmle/code/cpp/exprs Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -335,10 +335,10 @@ class Expr extends StmtParent, @expr {
335335 /** Gets the fully converted form of this expression, including all type casts and other conversions. */
336336 cached
337337 Expr getFullyConverted ( ) {
338- if this . hasConversion ( ) then
339- result = this . getConversion ( ) . getFullyConverted ( )
340- else
341- result = this
338+ hasNoConversions ( this ) and
339+ result = this
340+ or
341+ result = this . getConversion ( ) . getFullyConverted ( )
342342 }
343343
344344 /**
@@ -977,3 +977,6 @@ private predicate isStandardPlacementNewAllocator(Function operatorNew) {
977977 operatorNew .getNumberOfParameters ( ) = 2 and
978978 operatorNew .getParameter ( 1 ) .getType ( ) instanceof VoidPointerType
979979}
980+
981+ // Pulled out for performance. See QL-796.
982+ private predicate hasNoConversions ( Expr e ) { not e .hasConversion ( ) }
You can’t perform that action at this time.
0 commit comments