示例#1
0
 function reduce_failure($reason, $bundle)
 {
     inst("reduce failure: {$reason}, {$bundle->subject}");
     global $phc;
     $subject = $bundle->subject;
     if (isset($this->is_special_reduction[$subject])) {
         // Found: we're already reducing, and the bug is kept in
         $this->reduction_result[$subject] = true;
     } else {
         // Start reducing
         try {
             $reduce = new Reduce();
             $this->reductions[$subject] = $reduce;
             $reduce->set_checking_function(array($this, "reduce_checking_function"));
             $reduce->set_run_command_function(array($this, "reduce_run_function"));
             $reduce->set_phc($phc);
             $reduce->set_debug_function(array($this, "reduce_debug_function"));
             // Get the file, and send it to the reducer
             $contents = file_get_contents($subject);
             if (!$reduce->has_syntax_errors($contents)) {
                 $final_contents = $reduce->run_on_php($contents);
                 file_put_contents("{$subject}.{$this->get_name()}_reduced", $final_contents);
             }
         } catch (ReduceException $e) {
             // There can be lots of reasons for this, many benign. Ignore it.
         }
         $this->mark_failure($bundle->subject, $bundle->commands, $bundle->outs, $bundle->errs, $bundle->exits, $reason);
     }
 }