[PATCH] D152140: [Clang] Limit FunctionTypeExtraBitfields::NumExceptionType to 16 bits.

Sander de Smalen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 5 07:24:42 PDT 2023


sdesmalen added inline comments.


================
Comment at: clang/lib/AST/Type.cpp:3374
     auto &ExtraBits = *getTrailingObjects<FunctionTypeExtraBitfields>();
-    ExtraBits.NumExceptionType = epi.ExceptionSpec.Exceptions.size();
+    auto NumExceptions = epi.ExceptionSpec.Exceptions.size();
+    assert(NumExceptions <= UINT16_MAX &&
----------------
erichkeane wrote:
> So this isn't a place where we're allowed to use `auto`.  We can only use it if the type is listed on the RHS (like in the case of casts/etc).
You're absolutely right, sorry about that!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152140



More information about the cfe-commits mailing list