C++: Add isThisAccess predicate to ParamAccessForType

This commit is contained in:
Jeroen Ketema
2026-01-09 14:07:57 +01:00
parent bb33ea383c
commit 047fa068ff
2 changed files with 9 additions and 0 deletions

View File

@@ -394,6 +394,11 @@ class FunctionAccess extends Access, @routineexpr {
*/
class ParamAccessForType extends Expr, @param_ref {
override string toString() { result = "param access" }
/**
* Holds if the accessed parameter is implicit object parameter of the function.
*/
predicate isThisAccess() { param_ref_to_this(underlyingElement(this)) }
}
/**

View File

@@ -2040,6 +2040,10 @@ new_array_allocated_type(
int type_id: @type ref
);
param_ref_to_this(
int expr: @param_ref ref
)
/**
* The field being initialized by an initializer expression within an aggregate
* initializer for a class/struct/union. Position is used to sort repeated initializers.