aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/ChangeLog7
-rw-r--r--gcc/c/c-convert.c12
2 files changed, 11 insertions, 8 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index ccb7346..379f002 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,10 @@
+2016-01-06 Marek Polacek <polacek@redhat.com>
+
+ PR sanitizer/69099
+ * c-convert.c (convert) [INTEGER_TYPE]: Drop ARG. Don't pass ARG to
+ ubsan_instrument_float_cast. Fold EXPR. Use NULL_TREE instead of
+ NULL.
+
2016-01-04 Jakub Jelinek <jakub@redhat.com>
Update copyright years.
diff --git a/gcc/c/c-convert.c b/gcc/c/c-convert.c
index 5ee52eb..4167c34 100644
--- a/gcc/c/c-convert.c
+++ b/gcc/c/c-convert.c
@@ -111,20 +111,16 @@ convert (tree type, tree expr)
&& COMPLETE_TYPE_P (type)
&& do_ubsan_in_current_function ())
{
- tree arg;
if (in_late_binary_op)
- {
- expr = save_expr (expr);
- arg = expr;
- }
+ expr = save_expr (expr);
else
{
expr = c_save_expr (expr);
- arg = c_fully_fold (expr, false, NULL);
+ expr = c_fully_fold (expr, false, NULL);
}
- tree check = ubsan_instrument_float_cast (loc, type, expr, arg);
+ tree check = ubsan_instrument_float_cast (loc, type, expr);
expr = fold_build1 (FIX_TRUNC_EXPR, type, expr);
- if (check == NULL)
+ if (check == NULL_TREE)
return expr;
return fold_build2 (COMPOUND_EXPR, TREE_TYPE (expr), check, expr);
}