Commit 802ac282 by Marek Polacek Committed by Marek Polacek

c-convert.c (convert): Make use of do_ubsan_in_current_function.

	* c-convert.c (convert): Make use of do_ubsan_in_current_function.
	* c-decl.c (grokdeclarator): Likewise.
	* c-typeck.c (build_binary_op): Likewise.

From-SVN: r221278
parent e0d514da
2015-03-09 Marek Polacek <polacek@redhat.com>
* c-convert.c (convert): Make use of do_ubsan_in_current_function.
* c-decl.c (grokdeclarator): Likewise.
* c-typeck.c (build_binary_op): Likewise.
2015-02-27 Marek Polacek <polacek@redhat.com>
PR c/65228
......
......@@ -121,9 +121,7 @@ convert (tree type, tree expr)
if (flag_sanitize & SANITIZE_FLOAT_CAST
&& TREE_CODE (TREE_TYPE (expr)) == REAL_TYPE
&& COMPLETE_TYPE_P (type)
&& current_function_decl != NULL_TREE
&& !lookup_attribute ("no_sanitize_undefined",
DECL_ATTRIBUTES (current_function_decl)))
&& do_ubsan_in_current_function ())
{
tree arg;
if (in_late_binary_op)
......
......@@ -5837,10 +5837,7 @@ grokdeclarator (const struct c_declarator *declarator,
warn_variable_length_array (name, size);
if (flag_sanitize & SANITIZE_VLA
&& decl_context == NORMAL
&& current_function_decl != NULL_TREE
&& !lookup_attribute ("no_sanitize_undefined",
DECL_ATTRIBUTES
(current_function_decl)))
&& do_ubsan_in_current_function ())
{
/* Evaluate the array size only once. */
size = c_save_expr (size);
......
......@@ -11229,9 +11229,7 @@ build_binary_op (location_t location, enum tree_code code,
if ((flag_sanitize & (SANITIZE_SHIFT | SANITIZE_DIVIDE
| SANITIZE_FLOAT_DIVIDE))
&& current_function_decl != 0
&& !lookup_attribute ("no_sanitize_undefined",
DECL_ATTRIBUTES (current_function_decl))
&& do_ubsan_in_current_function ()
&& (doing_div_or_mod || doing_shift))
{
/* OP0 and/or OP1 might have side-effects. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment