This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug sanitizer/70147] testcase from hana testsuite gets miscompiled with -fsanitize=undefined
- From: "marxin at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 14 Mar 2016 10:34:52 +0000
- Subject: [Bug sanitizer/70147] testcase from hana testsuite gets miscompiled with -fsanitize=undefined
- Auto-submitted: auto-generated
- References: <bug-70147-4 at http dot gcc dot gnu dot org/bugzilla/>
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