diff options
author | Geoff Norton <grompf@gmail.com> | 2015-02-07 12:09:33 -0800 |
---|---|---|
committer | Geoff Norton <grompf@gmail.com> | 2015-02-07 12:09:33 -0800 |
commit | 944a21e253e92a1886dc62837479201624348e0e (patch) | |
tree | 368dbee4ba6ac0dad1954a7a515ebffff6e0b127 /src/jit/error.cpp | |
parent | 3ef44d46acba8c0544e455be4b1b7943fcc5596d (diff) | |
download | coreclr-944a21e253e92a1886dc62837479201624348e0e.tar.gz coreclr-944a21e253e92a1886dc62837479201624348e0e.tar.bz2 coreclr-944a21e253e92a1886dc62837479201624348e0e.zip |
Ensure that every usage of va_start is complemented by a va_end
Diffstat (limited to 'src/jit/error.cpp')
-rw-r--r-- | src/jit/error.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/jit/error.cpp b/src/jit/error.cpp index 68200efe8e..348b190e4b 100644 --- a/src/jit/error.cpp +++ b/src/jit/error.cpp @@ -389,13 +389,19 @@ void logf(const char* fmt, ...) // If it fails to log an LL_INFO1000 message once // it will always fail when logging an LL_INFO1000 message. // - if (logToEEfailed || !vlogf(LL_INFO1000, fmt, args)) + if (logToEEfailed) + { + logf_stdout(fmt, args); + } + else if (!vlogf(LL_INFO1000, fmt, args)) { logToEEfailed = true; - // If the EE refuses to log it, we try to send it to stdout - // - logf_stdout(fmt, args); + // The vlogf call may have modified args, so we need to reset it + va_end(args); + va_start(args, fmt); + + logf_stdout(fmt, args); } #if 0 // Enable this only when you need it else @@ -424,6 +430,7 @@ void logf(const char* fmt, ...) } } #endif // 0 + va_end(args); } @@ -433,6 +440,7 @@ void logf(unsigned level, const char* fmt, ...) va_list args; va_start(args, fmt); vlogf(level, fmt, args); + va_end(args); } void DECLSPEC_NORETURN badCode3(const char* msg, const char* msg2, int arg, |