Open jaykrell opened 1 week ago
More information.
C:\s>type break-in-finally.c
int main()
{
int a = 10;
while (a < 100)
{
__try {
a += 10;
printf("1\n");
*(volatile char*)0;
printf("2\n");
a += 10;
}
__finally
{
printf("3\n");
break;
}
}
printf("4\n");
return a;
}
C:\s>cl break-in-finally.c && break-in-finally.exe
Microsoft (R) C/C++ Optimizing Compiler Version 19.41.34123 for x64
break-in-finally.c(16): warning C4532: 'break': jump out of __finally block has undefined behavior during
1
3
4
see also https://github.com/microsoft/compiler-tests/blob/master/seh/seh0043.c
https://github.com/microsoft/compiler-tests/blob/master/seh/seh0048.c