https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70147

--- Comment #7 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
But how about that?


diff -up gcc/cp/cp-ubsan.c.jj gcc/cp/cp-ubsan.c
--- gcc/cp/cp-ubsan.c.jj        2016-03-04 23:10:49.000000000 +0100
+++ gcc/cp/cp-ubsan.c   2016-03-14 12:09:38.730344495 +0100
@@ -283,7 +283,7 @@ cp_ubsan_dfs_initialize_vtbl_ptrs (tree
   if (!TYPE_CONTAINS_VPTR_P (BINFO_TYPE (binfo)))
     return dfs_skip_bases;

-  if (!BINFO_PRIMARY_P (binfo) || BINFO_VIRTUAL_P (binfo))
+  if (!BINFO_PRIMARY_P (binfo) && !BINFO_VIRTUAL_P (binfo))
     {
       tree base_ptr = TREE_VALUE ((tree) data);




Which does just do the instrumentation on the simple case,
and leaves the virtual base classes alone.
At least the test case from PR70035 does not use virtual base
classes, and will still work.

Reply via email to