Commit 1f0858d7 by David Malcolm Committed by David Malcolm

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
parent 375550c6
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> 2014-12-11 David Malcolm <dmalcolm@redhat.com>
* docs/cp/topics/contexts.rst (gccjit::context::set_str_option): * docs/cp/topics/contexts.rst (gccjit::context::set_str_option):
......
...@@ -831,7 +831,7 @@ recording::context::set_str_option (enum gcc_jit_str_option opt, ...@@ -831,7 +831,7 @@ recording::context::set_str_option (enum gcc_jit_str_option opt,
return; return;
} }
free (m_str_options[opt]); 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 /* Set the given integer option for this context, or add an error if
......
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