File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -182,10 +182,13 @@ class Win32SymbolDebuggingContext final : public NativeSymbolDebuggingContext {
182182 return NameAndDisplacement (pSymbol->Name , dwDisplacement);
183183 } else {
184184 // SymFromAddr failed
185- const DWORD error = GetLastError (); // "eat" the error anyway
186185#ifdef DEBUG
186+ const DWORD error = GetLastError ();
187187 fprintf (stderr, " SymFromAddr returned error : %lu\n " , error);
188- #endif
188+ #else
189+ // Consume the error anyway
190+ USE (GetLastError ());
191+ #endif // DEBUG
189192 }
190193 // End MSDN code
191194
@@ -217,10 +220,13 @@ class Win32SymbolDebuggingContext final : public NativeSymbolDebuggingContext {
217220 sym.line = line.LineNumber ;
218221 } else {
219222 // SymGetLineFromAddr64 failed
220- const DWORD error = GetLastError (); // "eat" the error anyway
221223#ifdef DEBUG
224+ const DWORD error = GetLastError ();
222225 fprintf (stderr, " SymGetLineFromAddr64 returned error : %lu\n " , error);
223- #endif
226+ #else
227+ // Consume the error anyway
228+ USE (GetLastError ());
229+ #endif // DEBUG
224230 }
225231 // End MSDN code
226232
@@ -240,10 +246,13 @@ class Win32SymbolDebuggingContext final : public NativeSymbolDebuggingContext {
240246 return szUndName;
241247 } else {
242248 // UnDecorateSymbolName failed
243- const DWORD error = GetLastError (); // "eat" the error anyway
244249#ifdef DEBUG
250+ const DWORD error = GetLastError ();
245251 fprintf (stderr, " UnDecorateSymbolName returned error %lu\n " , error);
246- #endif
252+ #else
253+ // Consume the error anyway
254+ USE (GetLastError ());
255+ #endif // DEBUG
247256 }
248257 return nullptr ;
249258 }
You can’t perform that action at this time.
0 commit comments