aboutsummaryrefslogtreecommitdiff
path: root/gcc/ubsan.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ubsan.c')
-rw-r--r--gcc/ubsan.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/ubsan.c b/gcc/ubsan.c
index 5effd55..f2b66bf 100644
--- a/gcc/ubsan.c
+++ b/gcc/ubsan.c
@@ -229,8 +229,8 @@ ubsan_source_location (location_t loc)
xloc = expand_location (loc);
/* Fill in the values from LOC. */
- size_t len = strlen (xloc.file);
- tree str = build_string (len + 1, xloc.file);
+ size_t len = xloc.file ? strlen (xloc.file) : 0;
+ tree str = build_string (len + 1, xloc.file ? xloc.file : "");
TREE_TYPE (str) = build_array_type (char_type_node,
build_index_type (size_int (len)));
TREE_READONLY (str) = 1;
@@ -644,7 +644,7 @@ ubsan_pass (void)
{
struct walk_stmt_info wi;
gimple stmt = gsi_stmt (gsi);
- if (is_gimple_debug (stmt))
+ if (is_gimple_debug (stmt) || gimple_clobber_p (stmt))
{
gsi_next (&gsi);
continue;