[clang] e3bd627 - [clang][Interp][NFC] Retrieve active union field in Pointer::toRValue()

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Wed May 22 06:32:07 PDT 2024


Author: Timm Bäder
Date: 2024-05-22T15:31:44+02:00
New Revision: e3bd627f53b6c7e1c16368803c3f119910cc5c84

URL: https://github.com/llvm/llvm-project/commit/e3bd627f53b6c7e1c16368803c3f119910cc5c84
DIFF: https://github.com/llvm/llvm-project/commit/e3bd627f53b6c7e1c16368803c3f119910cc5c84.diff

LOG: [clang][Interp][NFC] Retrieve active union field in Pointer::toRValue()

Added: 
    

Modified: 
    clang/lib/AST/Interp/Pointer.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/Interp/Pointer.cpp b/clang/lib/AST/Interp/Pointer.cpp
index e45c291668caf..252f7ea46086f 100644
--- a/clang/lib/AST/Interp/Pointer.cpp
+++ b/clang/lib/AST/Interp/Pointer.cpp
@@ -351,6 +351,7 @@ std::optional<APValue> Pointer::toRValue(const Context &Ctx) const {
             } else {
               Ok &= Composite(FieldTy, FP, Value);
             }
+            ActiveField = FP.getFieldDesc()->asFieldDecl();
             break;
           }
         }


        


More information about the cfe-commits mailing list