This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Ubsan and cgraph rebuilding (PR sanitizer/65538)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Marek Polacek <polacek at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 27 Mar 2015 08:48:19 +0100
- Subject: Re: [PATCH] Ubsan and cgraph rebuilding (PR sanitizer/65538)
- Authentication-results: sourceware.org; auth=none
- References: <20150326235009 dot GC21260 at redhat dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Mar 27, 2015 at 12:50:09AM +0100, Marek Polacek wrote:
> 2015-03-26 Marek Polacek <polacek@redhat.com>
>
> PR sanitizer/65583
> * ubsan.c (ubsan_create_edge): New function.
> (instrument_bool_enum_load): Call it.
> (instrument_nonnull_arg): Likewise.
> (instrument_nonnull_return): Likewise.
> (instrument_object_size): Likewise.
>
> * g++.dg/ubsan/pr65583.C: New test.
Ok.
> @@ -1834,6 +1853,17 @@ instrument_object_size (gimple_stmt_iterator *gsi, bool is_lhs)
> integer_zero_node);
> sizet = force_gimple_operand_gsi (gsi, sizet, false, NULL_TREE, true,
> GSI_SAME_STMT);
> + /* If the call above didn't end up being an integer constant, go one
> + statement back and get the __builtin_object_size stmt. Save it,
Though, perhaps for GCC 6 it would be better to avoid building tree __bos
call and instead just call compute_builtin_object_size and build_int_cstu
if it returns non--1, and otherwise just gimple_build_call.
Jakub