Commit 75729cff by Jason Merrill Committed by Jason Merrill

lambda.c (maybe_add_lambda_conv_op): Only set no_sanitize_undefined if SANITIZE_NULL.

	* lambda.c (maybe_add_lambda_conv_op): Only set
	no_sanitize_undefined if SANITIZE_NULL.

From-SVN: r230908
parent b5f34b42
2015-11-25 Jason Merrill <jason@redhat.com> 2015-11-25 Jason Merrill <jason@redhat.com>
* lambda.c (maybe_add_lambda_conv_op): Only set
no_sanitize_undefined if SANITIZE_NULL.
PR c++/67941 PR c++/67941
* lambda.c (maybe_add_lambda_conv_op): Mark _FUN as * lambda.c (maybe_add_lambda_conv_op): Mark _FUN as
no_sanitize_undefined. no_sanitize_undefined.
......
...@@ -1053,11 +1053,14 @@ maybe_add_lambda_conv_op (tree type) ...@@ -1053,11 +1053,14 @@ maybe_add_lambda_conv_op (tree type)
if (generic_lambda_p) if (generic_lambda_p)
fn = add_inherited_template_parms (fn, DECL_TI_TEMPLATE (callop)); fn = add_inherited_template_parms (fn, DECL_TI_TEMPLATE (callop));
/* Don't UBsan this function; we're deliberately calling op() with a null if (flag_sanitize & SANITIZE_NULL)
object argument. */ {
tree attrs = build_tree_list (get_identifier ("no_sanitize_undefined"), /* Don't UBsan this function; we're deliberately calling op() with a null
NULL_TREE); object argument. */
cplus_decl_attributes (&fn, attrs, 0); tree attrs = build_tree_list (get_identifier ("no_sanitize_undefined"),
NULL_TREE);
cplus_decl_attributes (&fn, attrs, 0);
}
add_method (type, fn, NULL_TREE); add_method (type, fn, NULL_TREE);
......
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