Просмотр исходного кода

Truncate lines in bjam.log to 8k bytes to avoid very deep recursion
in the split function in process_jam_log.cpp. This patch fixes
process_jam_log crashes resulting from 500k byte pgi compiler
messages.



[SVN r42429]

K. Noel Belcourt 18 лет назад
Родитель
Сommit
88beb044cf
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      tools/regression/src/process_jam_log.cpp

+ 3 - 0
tools/regression/src/process_jam_log.cpp

@@ -633,9 +633,12 @@ int main( int argc, char ** argv )
   //   * Calls stop_message() to stop capturing lines.
   //   * Capture lines if line capture on.
 
+  static const int max_line_length = 8192;
   int line_num = 0;
   while ( std::getline( *input, line ) )
   {
+    if (max_line_length < line.size()) line = line.substr(0, max_line_length);
+
     ++line_num;
     
     std::vector<std::string> const line_parts( split( line ) );

粤ICP备19079148号