Changeset 242075 in webkit
- Timestamp:
- Feb 25, 2019 10:44:06 PM (5 years ago)
- Location:
- trunk/Source/WTF
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r242048 r242075 1 2019-02-25 Xabier Rodriguez Calvar <calvaris@igalia.com> 2 3 Fix WTFLogVerbose variadic parameters forwarding 4 https://bugs.webkit.org/show_bug.cgi?id=194920 5 6 Reviewed by Alex Christensen. 7 8 WTFLogVerbose was passing the va_list to WTFLog but this function 9 also used variadic parameters and this is not allowed in C (that 10 part of the code is extern "C"). 11 12 * wtf/Assertions.cpp: 13 (WTF::WTFLogVaList): Created to take a va_list argument instead of 14 variadic parameters. 15 (WTF::WTFLog): Kept with variadic parameters, which are 16 transformed to va_list and passed to WTFLogVaList. 17 (WTF::WTFLogVerbose): Use WTFLogVaList instead of WTFLog. 18 1 19 2019-02-25 Sam Weinig <sam@webkit.org> 2 20 -
trunk/Source/WTF/wtf/Assertions.cpp
r242014 r242075 431 431 } 432 432 433 void WTFLog(WTFLogChannel* channel, const char* format, ...)433 static void WTFLogVaList(WTFLogChannel* channel, const char* format, va_list args) 434 434 { 435 435 if (channel->state == WTFLogChannelOff) … … 437 437 438 438 if (channel->state == WTFLogChannelOn) { 439 va_list args;440 va_start(args, format);441 439 vprintf_stderr_with_trailing_newline(format, args); 442 va_end(args);443 440 return; 444 441 } 445 442 446 443 ASSERT(channel->state == WTFLogChannelOnWithAccumulation); 447 448 va_list args;449 va_start(args, format);450 444 451 445 ALLOW_NONLITERAL_FORMAT_BEGIN … … 453 447 ALLOW_NONLITERAL_FORMAT_END 454 448 455 va_end(args);456 457 449 if (!loggingString.endsWith('\n')) 458 450 loggingString.append('\n'); … … 463 455 } 464 456 457 void WTFLog(WTFLogChannel* channel, const char* format, ...) 458 { 459 va_list args; 460 va_start(args, format); 461 462 WTFLogVaList(channel, format, args); 463 464 va_end(args); 465 } 466 465 467 void WTFLogVerbose(const char* file, int line, const char* function, WTFLogChannel* channel, const char* format, ...) 466 468 { … … 472 474 473 475 ALLOW_NONLITERAL_FORMAT_BEGIN 474 WTFLog (channel, format, args);476 WTFLogVaList(channel, format, args); 475 477 ALLOW_NONLITERAL_FORMAT_END 476 478
Note: See TracChangeset
for help on using the changeset viewer.