File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -11,13 +11,18 @@ private import TypeFlow
1111private import semmle.code.cpp.ir.ValueNumbering
1212
1313/**
14- * Gets the C++ type of `this` in the member function `f`.
14+ * Gets the C++ type of `this` in an `IRFunction` generated from `f`.
1515 * The result is a glvalue if `isGLValue` is true, and
1616 * a prvalue if `isGLValue` is false.
1717 */
1818bindingset [ isGLValue]
19- private CppType getThisType ( Cpp:: MemberFunction f , boolean isGLValue ) {
20- result .hasType ( f .getTypeOfThis ( ) , isGLValue )
19+ private CppType getThisType ( Cpp:: Declaration f , boolean isGLValue ) {
20+ result .hasType ( f .( Cpp:: MemberFunction ) .getTypeOfThis ( ) , isGLValue )
21+ or
22+ exists ( Cpp:: PointerType pt |
23+ pt .getBaseType ( ) = f .( Cpp:: Field ) .getDeclaringType ( ) and
24+ result .hasType ( pt , isGLValue )
25+ )
2126}
2227
2328/**
You can’t perform that action at this time.
0 commit comments