sanitizer_common's consumers use SanitizerCommonDecorator to color their output in various cases. In some cases they end up emitting several escape sequences in a row that don't end up having any effect, e.g. PrintShadowBytes will transition to bold+color, print a byte, transition to default, transition back to bold+color, etc. This extra transitions end up being passed to the RawWrite call in sanitizer_printf.cc. If the implementation of RawWrite has a fixed buffer size (e.g. as in sanitizer_fuchsia.cc), this can cause the buffer to be consumed unnecessary and even end up breaking the line in the middle of an escape sequence.
This change attempts to mitigate that problem by providing SanitizerCommonDecorator::Compact, which removes sequences that would simply be overwritten by subsequent sequences.
INLINE is not necessary
can this be?