This is the mail archive of the gcc-patches@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]

Re: [PATCH] Ubsan and cgraph rebuilding (PR sanitizer/65538)


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


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