[PATCH] D140874: [clang][Interp] Support pointer types in compound assignment operations

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 3 06:54:40 PST 2023


erichkeane added a comment.

I'm pretty far behind on reviews of the interpreter, but this one I noticed while looking th rough it.



================
Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:710
+
+  assert(*LT == PT_Ptr);
+
----------------
This is UB here if LT doesn't contain a value.  Additionally, it makes line 712 really odd here.  It seems that LT isn't really used anywhere in this function.  I know classify is meaningful here (and thus needs to run), but I wonder if we want to make this:

`assert(LT && *LT == PT_Ptr);` and take out the 1st test on 712.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140874



More information about the cfe-commits mailing list