Correct exception handler sprintf for 32-bit (#3608)

The size of ULONG_PTR varies based on the address size of the
architecture. For 32-bit systems, it was invalid to treat it like a
64-bit value. By casting the value to a void pointer and changing the
print code to %p, we get the right thing for all platforms
This commit is contained in:
Greg Roth 2021-03-19 14:08:12 -06:00 коммит произвёл GitHub
Родитель 9b475a7fa3
Коммит 0e892065bd
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -1241,7 +1241,7 @@ static LONG CALLBACK ExceptionFilter(PEXCEPTION_POINTERS pExceptionInfo)
else
fputs("read", stderr);
fputs(" from address ", stderr);
sprintf_s(scratch, _countof(scratch), "0x%016llx\n", pExceptionInfo->ExceptionRecord->ExceptionInformation[1]);
sprintf_s(scratch, _countof(scratch), "0x%p\n", (void*)pExceptionInfo->ExceptionRecord->ExceptionInformation[1]);
fputs(scratch, stderr);
} break;
case EXCEPTION_STACK_OVERFLOW: