[clang] [clang][bytecode] Handle bitcasts involving bitfields (PR #116843)

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 20 07:01:47 PST 2024


================
@@ -295,62 +218,56 @@ static bool CheckBitcastType(InterpState &S, CodePtr OpPC, QualType T,
 static bool readPointerToBuffer(const Context &Ctx, const Pointer &FromPtr,
                                 BitcastBuffer &Buffer, bool ReturnOnUninit) {
   const ASTContext &ASTCtx = Ctx.getASTContext();
-  bool SwapData = (ASTCtx.getTargetInfo().isLittleEndian() !=
-                   llvm::sys::IsLittleEndianHost);
-  bool BigEndianTarget = ASTCtx.getTargetInfo().isBigEndian();
+  Endian TargetEndianness =
+      ASTCtx.getTargetInfo().isLittleEndian() ? Endian::Little : Endian::Big;
 
   return enumeratePointerFields(
       FromPtr, Ctx,
       [&](const Pointer &P, PrimType T, size_t BitOffset,
           bool PackedBools) -> bool {
-        if (!P.isInitialized()) {
-          assert(false && "Implement uninitialized value tracking");
-          return ReturnOnUninit;
-        }
+        // if (!P.isInitialized()) {
----------------
tbaederr wrote:

Kinda, it will be needed in the future but for now we can't assert here (anymore) since there's a different problem where we're not marking bases as initialized. not having the assert here enables us to do more testing.

https://github.com/llvm/llvm-project/pull/116843


More information about the cfe-commits mailing list