================
@@ -2332,6 +2332,13 @@ static bool interp__builtin_object_size(InterpState &S, 
CodePtr OpPC,
     }
   }
 
+  // The "closest surrounding subobject" is NOT a base class,
+  // so strip the base class casts.
+  if (UseFieldDesc && Ptr.isBaseClass()) {
+    while (Ptr.isBaseClass())
+      Ptr = Ptr.getBase();
----------------
shafik wrote:

The name of `getBase` is particularly unfortunate for readability, especially 
given the the comment above. While `getBase` makes sense in isolation of the 
`Pointer` type, in the wider context of C++ the name is quite overloaded.

https://github.com/llvm/llvm-project/pull/176111
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to