Call release_input_file only if file is claimed
authorH.J. Lu <hongjiu.lu@intel.com>
Thu, 5 Feb 2015 16:40:44 +0000 (16:40 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Thu, 5 Feb 2015 16:40:44 +0000 (08:40 -0800)
* lto-plugin.c (claim_file_handler): Call release_input_file only
if file is claimed.

From-SVN: r220455

lto-plugin/ChangeLog
lto-plugin/lto-plugin.c

index 81752e73716f1e6ae40ed1d44a9d010bd2312a02..510e7385884233b92b2a5c5d6c8f1f6e9d1a49bc 100644 (file)
@@ -1,3 +1,8 @@
+2015-02-05  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * lto-plugin.c (claim_file_handler): Call release_input_file only
+       if file is claimed.
+
 2015-01-28  H.J. Lu  <hongjiu.lu@intel.com>
 
        * lto-plugin.c (claim_file_handler): Call release_input_file only
index add83f2c5c55a0b3ea07d0b34041e6ec4f49fbbd..e25bbf9c44e7495fcedbbb4696145ad1ecf620f0 100644 (file)
@@ -998,6 +998,9 @@ claim_file_handler (const struct ld_plugin_input_file *file, int *claimed)
 
   *claimed = 1;
 
+  if (release_input_file)
+    release_input_file (file);
+
   goto cleanup;
 
  err:
@@ -1007,9 +1010,6 @@ claim_file_handler (const struct ld_plugin_input_file *file, int *claimed)
   if (obj.objfile)
     simple_object_release_read (obj.objfile);
 
-  if (release_input_file)
-    release_input_file (file);
-
   return LDPS_OK;
 }