Skip to content

Commit 24abec6

Browse files
committed
Dereferencing null is UB.
Change the load to a volatile load to stop the compiler from reasoning about it's behavior.
1 parent 86bcaeb commit 24abec6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

eh/terminate.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class C
3030
if (FGenSEHException)
3131
{
3232
printf("generating access violation (SEH)\n");
33-
*(char*)(0) = 0; // Uh, EHa, don't you think?
33+
*(volatile char*)(0) = 0; // Uh, EHa, don't you think?
3434
}
3535
else
3636
{

0 commit comments

Comments
 (0)