From b5300487f1c9c92f1f5bbe1063a0240154815f47 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Thu, 27 Oct 2016 08:38:07 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 5 +++++ gcc/plugin.c | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) 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; } -- 2.30.2