================
@@ -126,6 +127,32 @@ static bool isInitializerOfDynamicClass(const
CXXCtorInitializer *baseInit) {
return baseClassDecl->isDynamicClass();
}
+namespace {
+/// A visitor which checks whether an initializer uses 'this' in a
+/// way which requires the vtable to be properly set.
+struct DynamicThisUseChecker
+ : ConstEvaluatedExprVisitor<DynamicThisUseChecker> {
+ using super = ConstEvaluatedExprVisitor<DynamicThisUseChecker>;
+
+ bool usesThis = false;
+
+ DynamicThisUseChecker(const ASTContext &c) : super(c) {}
+
+ // Black-list all explicit and implicit references to 'this'.
+ //
+ // Do we need to worry about external references to 'this' derived
+ // from arbitrary code? If so, then anything which runs arbitrary
----------------
AmrDeveloper wrote:
```suggestion
// from arbitrary code? If so, then anything which runs arbitrary
```
https://github.com/llvm/llvm-project/pull/155275
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits