Skip to content
Unverified Commit c79b544d authored by jyu2-git's avatar jyu2-git Committed by GitHub
Browse files

[SEH] Fix assertin when return scalar value from __try block. (#71488)

Current compler assert with `!SI->isAtomic() && !SI->isVolatile()'
failed

This due to following rule:
First, no exception can move in or out of _try region., i.e., no
"potential faulty instruction can be moved across _try boundary. Second,
the order of exceptions for instructions 'directly' under a _try must be
preserved (not applied to those in callees). Finally, global states
(local/global/heap variables) that can be read outside of _try region
must be updated in memory (not just in register) before the subsequent
exception occurs.

All memory instructions inside a _try are considered as 'volatile' to
assure 2nd and 3rd rules for C-code above. This is a little
sub-optimized. But it's acceptable as the amount of code directly under
_try is very small. However during findDominatingStoreToReturnValue:
those are not allowed.

To fix just skip the assertion when current function has seh try.
parent 64ed4edc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment