[PATCH] D135513: [clang][Interp] Check instance pointers before calling functions on them

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 18 10:25:21 PDT 2022


aaron.ballman added inline comments.


================
Comment at: clang/lib/AST/Interp/Function.cpp:39
+  assert(It != SrcMap.end());
+  It--; // We want the offset *before* the given one.
   return It->second;
----------------
tbaeder wrote:
> While I think the comment here is correct, the decrement itself certainly isn't.
Which comment and which decrement? (Or is this a stale review comment?)


================
Comment at: clang/lib/AST/Interp/Interp.h:1131
+static bool Call(InterpState &S, CodePtr &PC, const Function *Func) {
+  auto *NewFrame = new InterpFrame(S, Func, PC);
+  if (Func->hasThisPointer()) {
----------------
Use a `unique_ptr` for this?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135513/new/

https://reviews.llvm.org/D135513



More information about the cfe-commits mailing list