From: Nick Clifton Date: Thu, 27 Oct 2016 08:38:07 +0000 (+0000) Subject: plugin.c (register_plugin_info): Produce an error message if the plugin is not found... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b5300487f1c9c92f1f5bbe1063a0240154815f47;p=gcc.git plugin.c (register_plugin_info): Produce an error message if the plugin is not found in the hash table. * plugin.c (register_plugin_info): Produce an error message if the plugin is not found in the hash table. From-SVN: r241613 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ee733cf6ad2..ca1502abb76 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2016-10-27 Nick Clifton + + * plugin.c (register_plugin_info): Produce an error message if the + plugin is not found in the hash table. + 2016-10-27 Bin Cheng * match.pd ((convert1 (minmax ((convert2 (x) c)))) -> minmax (x c)): diff --git a/gcc/plugin.c b/gcc/plugin.c index 60081a5a53b..9f63fa1955c 100644 --- a/gcc/plugin.c +++ b/gcc/plugin.c @@ -330,7 +330,15 @@ static void register_plugin_info (const char* name, struct plugin_info *info) { void **slot = htab_find_slot (plugin_name_args_tab, name, NO_INSERT); - struct plugin_name_args *plugin = (struct plugin_name_args *) *slot; + struct plugin_name_args *plugin; + + if (slot == NULL) + { + error ("unable to register info for plugin '%s' - plugin name not found", + name); + return; + } + plugin = (struct plugin_name_args *) *slot; plugin->version = info->version; plugin->help = info->help; }