* gold.cc (queue_middle_tasks): If no input files were opened,
authorIan Lance Taylor <ian@airs.com>
Tue, 23 Feb 2010 17:42:26 +0000 (17:42 +0000)
committerIan Lance Taylor <ian@airs.com>
Tue, 23 Feb 2010 17:42:26 +0000 (17:42 +0000)
exit.
* workqueue.h (Task_function::Task_function): Assert that there is
a blocker.

gold/ChangeLog
gold/gold.cc
gold/workqueue.h

index 056a506c704fcf189a76f84426b6a02fcad0dac0..45017f229bc1eefc78d3d8a1cc4042cc90922205 100644 (file)
@@ -1,3 +1,11 @@
+2010-02-23  Viktor Kutuzov  <vkutuzov@accesssoftek.com>
+           Ian Lance Taylor  <iant@google.com>
+
+       * gold.cc (queue_middle_tasks): If no input files were opened,
+       exit.
+       * workqueue.h (Task_function::Task_function): Assert that there is
+       a blocker.
+
 2010-02-22  Doug Kwan  <dougkwan@google.com>
 
        * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
index 275d0f92e235b419ed626a8f2389a808c46d8437..545057334233c1b57e8ba35f08fad8252499d10a 100644 (file)
@@ -532,6 +532,15 @@ queue_middle_tasks(const General_options& options,
         }
     }
 
+  // If we failed to open any input files, it's possible for
+  // THIS_BLOCKER to be NULL here.  There's no real point in
+  // continuing if that happens.
+  if (this_blocker == NULL)
+    {
+      gold_assert(parameters->errors()->error_count() > 0);
+      gold_exit(false);
+    }
+
   // When all those tasks are complete, we can start laying out the
   // output file.
   // TODO(csilvers): figure out a more principled way to get the target
index 75452241d80515f3d3dc6f2eff810c4ad25cf91c..9121e10e14f0a210a51bf04326cb5e7bf2a6c9b6 100644 (file)
@@ -152,7 +152,7 @@ class Task_function : public Task
   Task_function(Task_function_runner* runner, Task_token* blocker,
                const char* name)
     : runner_(runner), blocker_(blocker), name_(name)
-  { }
+  { gold_assert(blocker != NULL); }
 
   ~Task_function()
   {