diff options
author | Nick Clifton <nickc@redhat.com> | 2016-10-27 08:38:07 +0000 |
---|---|---|
committer | Nick Clifton <nickc@gcc.gnu.org> | 2016-10-27 08:38:07 +0000 |
commit | b5300487f1c9c92f1f5bbe1063a0240154815f47 (patch) | |
tree | 9a205f4e8075a586b54c5d2ae393c5fa91ae1b03 | |
parent | ad6e4ba8de6dc0efd62754164d432f9349beb25b (diff) | |
download | gcc-b5300487f1c9c92f1f5bbe1063a0240154815f47.zip gcc-b5300487f1c9c92f1f5bbe1063a0240154815f47.tar.gz gcc-b5300487f1c9c92f1f5bbe1063a0240154815f47.tar.bz2 |
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
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/plugin.c | 10 |
2 files changed, 14 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ee733cf..ca1502a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2016-10-27 Nick Clifton <nickc@redhat.com> + + * plugin.c (register_plugin_info): Produce an error message if the + plugin is not found in the hash table. + 2016-10-27 Bin Cheng <bin.cheng@arm.com> * match.pd ((convert1 (minmax ((convert2 (x) c)))) -> minmax (x c)): diff --git a/gcc/plugin.c b/gcc/plugin.c index 60081a5..9f63fa1 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; } |