+2014-12-01 David Malcolm <dmalcolm@redhat.com>
+
+ * jit-builtins.c
+ (gcc::jit::recording::builtins_manager::get_builtin_function):
+ Check for NULL return from make_builtin_function.
+ (gcc::jit::recording::builtins_manager::make_builtin_function):
+ Check for NULL return from get_type.
+
2014-12-01 David Malcolm <dmalcolm@redhat.com>
* jit-playback.c (gcc::jit::playback::context::compile): Move DSO
the same id on a context give back the same object. */
if (!m_builtin_functions[builtin_id])
{
- m_builtin_functions[builtin_id] = make_builtin_function (builtin_id);
- m_ctxt->record (m_builtin_functions[builtin_id]);
+ function *fn = make_builtin_function (builtin_id);
+ if (fn)
+ {
+ m_builtin_functions[builtin_id] = fn;
+ m_ctxt->record (fn);
+ }
}
return m_builtin_functions[builtin_id];
{
const struct builtin_data& bd = builtin_data[builtin_id];
enum jit_builtin_type type_id = bd.type;
- function_type *func_type = get_type (type_id)->as_a_function_type ();
+ type *t = get_type (type_id);
+ if (!t)
+ return NULL;
+ function_type *func_type = t->as_a_function_type ();
if (!func_type)
return NULL;