Skip to content

Commit a7c46bf

Browse files
Greg Rothtex3d
authored andcommitted
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 (cherry picked from commit 0e89206)
1 parent 7fa4cfa commit a7c46bf

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tools/clang/tools/dxclib/dxc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1185,7 +1185,7 @@ static LONG CALLBACK ExceptionFilter(PEXCEPTION_POINTERS pExceptionInfo)
11851185
else
11861186
fputs("read", stderr);
11871187
fputs(" from address ", stderr);
1188-
sprintf_s(scratch, _countof(scratch), "0x%016llx\n", pExceptionInfo->ExceptionRecord->ExceptionInformation[1]);
1188+
sprintf_s(scratch, _countof(scratch), "0x%p\n", (void*)pExceptionInfo->ExceptionRecord->ExceptionInformation[1]);
11891189
fputs(scratch, stderr);
11901190
} break;
11911191
case EXCEPTION_STACK_OVERFLOW:

0 commit comments

Comments
 (0)