Commit 4054e78
Cygwin: SEH: Fix crash and handle second unwind phase on AArch64
This patch adds the SEH_CODE macro (defined in cygtls.h) and refactors
the TRY_HANDLER_DATA metadata, fixing code styling and allowing it to
be used on both AArch64 and x86_64 architectures.
It also makes modifications to the exception handler responsible for the
__try and __except blocks.
The first change to the handler fixes a bug where the existing
exception context record is reused as an unwind context record, which
fails with a crash on Windows on Arm (AArch64). The fix is to create a
new record instead, while leaving the original one intact.
The second change adds an additional condition for cases when the
handler is called again in the second phase of unwinding on certain
platforms such as Windows on Arm (AArch64). In this case, the value
ExceptionContinueSearch is simply returned without making any changes.
Tests fixed on AArch64:
winsup.api/ltp/access03.exe
winsup.api/ltp/access05.exe
winsup.api/ltp/chdir04.exe
winsup.api/ltp/mkdir01.exe
winsup.api/ltp/rename08.exe
winsup.api/ltp/rmdir05.exe
winsup.api/ltp/stat03.exe
winsup.api/ltp/stat06.exe
winsup.api/ltp/symlink01.exe
winsup.api/ltp/symlink03.exe
winsup.api/ltp/times02.exe
winsup.api/ltp/unlink07.exe
Signed-off-by: Igor Podgainoi <igor.podgainoi@arm.com>1 parent 9c2ea08 commit 4054e78
2 files changed
Lines changed: 23 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
618 | 618 | | |
619 | 619 | | |
620 | 620 | | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
621 | 624 | | |
622 | | - | |
623 | | - | |
624 | | - | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
625 | 629 | | |
626 | 630 | | |
627 | 631 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
344 | 344 | | |
345 | 345 | | |
346 | 346 | | |
347 | | - | |
| 347 | + | |
348 | 348 | | |
349 | | - | |
350 | | - | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
351 | 352 | | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
| 353 | + | |
360 | 354 | | |
361 | 355 | | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
362 | 367 | | |
363 | 368 | | |
364 | 369 | | |
| |||
0 commit comments