aboutsummaryrefslogtreecommitdiff
path: root/gcc/jit
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2014-12-19 19:33:29 +0000
committerDavid Malcolm <dmalcolm@gcc.gnu.org>2014-12-19 19:33:29 +0000
commit1f0858d762302ef84a5c4da165cb3129b83e7082 (patch)
treee12db36ae8e9e15caf81a84da05228e7731c2c59 /gcc/jit
parent375550c647d112d5ae064401074507ff14092ddd (diff)
downloadgcc-1f0858d762302ef84a5c4da165cb3129b83e7082.zip
gcc-1f0858d762302ef84a5c4da165cb3129b83e7082.tar.gz
gcc-1f0858d762302ef84a5c4da165cb3129b83e7082.tar.bz2
Handle NULL in gcc_jit_context_set_str_option
gcc/jit/ChangeLog: * jit-recording.c (gcc::jit::recording::context::set_str_option): Handle NULL. From-SVN: r218969
Diffstat (limited to 'gcc/jit')
-rw-r--r--gcc/jit/ChangeLog5
-rw-r--r--gcc/jit/jit-recording.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/gcc/jit/ChangeLog b/gcc/jit/ChangeLog
index 71755ff..639f8e6 100644
--- a/gcc/jit/ChangeLog
+++ b/gcc/jit/ChangeLog
@@ -1,3 +1,8 @@
+2014-12-19 David Malcolm <dmalcolm@redhat.com>
+
+ * jit-recording.c (gcc::jit::recording::context::set_str_option):
+ Handle NULL.
+
2014-12-11 David Malcolm <dmalcolm@redhat.com>
* docs/cp/topics/contexts.rst (gccjit::context::set_str_option):
diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
index 9d6d26a..7d9da24 100644
--- a/gcc/jit/jit-recording.c
+++ b/gcc/jit/jit-recording.c
@@ -831,7 +831,7 @@ recording::context::set_str_option (enum gcc_jit_str_option opt,
return;
}
free (m_str_options[opt]);
- m_str_options[opt] = xstrdup (value);
+ m_str_options[opt] = value ? xstrdup (value) : NULL;
}
/* Set the given integer option for this context, or add an error if