Resolve CID 1312126 and maybe also CID 1288510

This commit is contained in:
Dmitry-Me 2015-07-23 16:35:47 +03:00
parent 856d496c71
commit 05a318f9e7
1 changed files with 7 additions and 7 deletions

View File

@ -580,22 +580,22 @@ static void PrintCallstack(FILE* f, PEXCEPTION_POINTERS ex)
static void writeMemoryErrorDetails(FILE* f, PEXCEPTION_POINTERS ex, const char* description) static void writeMemoryErrorDetails(FILE* f, PEXCEPTION_POINTERS ex, const char* description)
{ {
fputs(description, f); fputs(description, f);
fprintf(f, " (instruction: 0x%X) ", ex->ExceptionRecord->ExceptionAddress); fprintf(f, " (instruction: 0x%p) ", ex->ExceptionRecord->ExceptionAddress);
// Using %p for ULONG_PTR later on, so it must have size identical to size of pointer // Using %p for ULONG_PTR later on, so it must have size identical to size of pointer
// This is not the universally portable solution but good enough for Win32/64 // This is not the universally portable solution but good enough for Win32/64
C_ASSERT(sizeof(void*) == sizeof(ex->ExceptionRecord->ExceptionInformation[1])); C_ASSERT(sizeof(void*) == sizeof(ex->ExceptionRecord->ExceptionInformation[1]));
switch (ex->ExceptionRecord->ExceptionInformation[0]) { switch (ex->ExceptionRecord->ExceptionInformation[0]) {
case 0: case 0:
fprintf(f, "reading from 0x%X", fprintf(f, "reading from 0x%p",
ex->ExceptionRecord->ExceptionInformation[1]); reinterpret_cast<void*>(ex->ExceptionRecord->ExceptionInformation[1]));
break; break;
case 1: case 1:
fprintf(f, "writing to 0x%X", fprintf(f, "writing to 0x%p",
ex->ExceptionRecord->ExceptionInformation[1]); reinterpret_cast<void*>(ex->ExceptionRecord->ExceptionInformation[1]));
break; break;
case 8: case 8:
fprintf(f, "data execution prevention at 0x%X", fprintf(f, "data execution prevention at 0x%p",
ex->ExceptionRecord->ExceptionInformation[1]); reinterpret_cast<void*>(ex->ExceptionRecord->ExceptionInformation[1]));
break; break;
default: default:
break; break;