RFR(xs): 8153845: UL log write method missing essential assert
Marcus Larsson
marcus.larsson at oracle.com
Fri Apr 8 12:19:59 UTC 2016
Hi Robbin,
On 04/08/2016 01:54 PM, Robbin Ehn wrote:
>
> Hi all,
>
> Please review,
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8153845
>
> Tested with jprt.
>
> diff -r 35cb720769c5 src/share/vm/logging/logTagSet.cpp
> --- a/src/share/vm/logging/logTagSet.cpp Fri Apr 08 08:51:45 2016
> +0200
> +++ b/src/share/vm/logging/logTagSet.cpp Fri Apr 08 13:39:12 2016
> +0200
> @@ -98,6 +98,7 @@
> const size_t vwrite_buffer_size = 512;
>
> void LogTagSet::vwrite(LogLevelType level, const char* fmt, va_list
> args) {
> + assert(level >= LogLevel::Off && level < LogLevel::Count, "Log
> level is incorrect");
> char buf[vwrite_buffer_size];
> va_list saved_args; // For re-format on buf overflow.
> va_copy(saved_args, args);
>
>
Can we make the assert check "level >= LogLevel::First && level <=
LogLevel::Last" instead?
Thanks,
Marcus
>
> Thanks!
>
> /Robbin
More information about the hotspot-runtime-dev
mailing list