<div dir="ltr">Makes sense, but maybe we should refactor to use SanitizerCommonDecorator instead. I'll let UBSan folks have their say.<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jun 6, 2014 at 1:20 PM, Stephan Bergmann <span dir="ltr"><<a href="mailto:sbergman@redhat.com" target="_blank">sbergman@redhat.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 06/04/2014 07:05 PM, Sergey Matveev wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks, fixed in r210199.<br>
</blockquote>
<br>
...and, in a similar vein, for ubsan (it cannot simply use SanitizerCommonDecorator as that inherits AnsiColorDecorator protected). Â Works at least when -fsanitize=undefined is used in combination with another sanitizer like -fsanitize=address and ASAN_OPTIONS=color=always:<br>


<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Index: lib/ubsan/ubsan_diag.cc<br>
==============================<u></u>==============================<u></u>=======<br>
--- lib/ubsan/ubsan_diag.cc Â  Â  (revision 210250)<br>
+++ lib/ubsan/ubsan_diag.cc Â  Â  (working copy)<br>
@@ -265,7 +265,7 @@<br>
 }<br>
<br>
 Diag::~Diag() {<br>
- Â __sanitizer::<u></u>AnsiColorDecorator Decor(PrintsToTty());<br>
+ Â __sanitizer::<u></u>AnsiColorDecorator Decor(ColorizeReports());<br>
  Â SpinMutexLock l(&CommonSanitizerReportMutex)<u></u>;<br>
  Â Printf(Decor.Bold());<br>
<br>
</blockquote>
<br>
Stephan<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Generally, compiler-rt patches should be posted to llvm-commits, not<br>
cfe-commits.<br>
<br>
<br>
On Wed, Jun 4, 2014 at 8:12 PM, Stephan Bergmann <<a href="mailto:sbergman@redhat.com" target="_blank">sbergman@redhat.com</a><br>
<mailto:<a href="mailto:sbergman@redhat.com" target="_blank">sbergman@redhat.com</a>>> wrote:<br>
<br>
  Â  The below change to trunk projects/compiler-rt makes<br>
  Â  ASAN_OPTIONS=detect_leaks=1:__<u></u>color=always colorize the<br>
  Â  LeakSanitizer output as intended:<br>
<br>
  Â  Â  Â  Index: lib/lsan/lsan_common.cc<br>
  Â  Â  Â  ==============================<u></u>__============================<u></u>==__=======<br>
  Â  Â  Â  --- lib/lsan/lsan_common.cc Â  Â  (revision 210183)<br>
  Â  Â  Â  +++ lib/lsan/lsan_common.cc Â  Â  (working copy)<br>
  Â  Â  Â  @@ -133,7 +133,7 @@<br>
<br>
  Â  Â  Â  Â  class Decorator: private __sanitizer::__<u></u>AnsiColorDecorator {<br>
  Â  Â  Â  Â  Â public:<br>
  Â  Â  Â  - Â Decorator() :<br>
  Â  Â  Â  __sanitizer::__<u></u>AnsiColorDecorator(__<u></u>PrintsToTtyCached()) { }<br>
  Â  Â  Â  + Â Decorator() :<br>
  Â  Â  Â  __sanitizer::__<u></u>AnsiColorDecorator(__<u></u>ColorizeReports()) { }<br>
  Â  Â  Â  Â  Â  const char *Error() { return Red(); }<br>
  Â  Â  Â  Â  Â  const char *Leak() { return Blue(); }<br>
  Â  Â  Â  Â  Â  const char *End() { return Default(); }<br>
</blockquote>
<br>
</blockquote></div><br></div></div>