diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2019-09-18 11:31:21 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-09-18 11:31:21 -0700 |
| commit | a4c7cf32872c8bb191ee78ed91887a66f0b8b0f1 (patch) | |
| tree | 6f46f41631df24deecd87fa12769adacd41c8a9b /source/slang/slang-stdlib.cpp | |
| parent | 31c7abcc27a33d63ac8d335387a0ce7b3ad74954 (diff) | |
Fix a bug in SSA form creation (#1058)
It was possible for a recursive call to `tryRemoveTriviailPhi` to remove/replace a phi node that was already in a list of removal candidates to be processed. When the recursive call returned and that candidate was again considered, its operands would have already been cleared, leading to an assertion failure.
This case is what was coming up in practice in a user shader, although I have not been able to reproduce the failure with a more minimal synthetic test yet.
This change also changes the SSA creation logic to avoid a runtime crash in the case of a trivial phi that only references itself (which was how the above bug surfaced to the user). The "fix" there is not ideal (it leaves a trivial phi behind), but should be enough to retain semantic correctness if user code ever causes that (corneer-case) code path to execute. It is also expected that such a trivial phi would be removed in later DCE passes anyway.
Diffstat (limited to 'source/slang/slang-stdlib.cpp')
0 files changed, 0 insertions, 0 deletions
