This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug sanitizer/70147] testcase from hana testsuite gets miscompiled with -fsanitize=undefined


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

--- Comment #6 from Martin LiÅka <marxin at gcc dot gnu.org> ---
Thank you Jakub for the reduced test-case.
As I've read the source code, current_vtt_parm is
properly defined in start_preparsed_function function.

vtt_parm definition:
/* In a base member initializer, we cannot rely on the
vtable being set up.  We have to indirect via the vtt_parm.  */

So as suggested by Jakub, we have to somehow replace
((struct C *) this)->D.2663.D.2604._vptr.A with read of current_vtt_parm
which can be quite easily passed to cp_ubsan_dfs_initialize_vtbl_ptrs.

Question is how to easily replace these? Should I process a dfs_walk a replace
all occurrences, or is there any easier approach?

Thanks,
Martin

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]