Commit 56beac9
authored
[SPIRV] Fix assertion violation caused by unexpected ConstantExpr. (#170524)
`SPIRVEmitIntrinsics::simplifyZeroLengthArrayGepInst` asserted that it
always expected a `GetElementPtrInst` from `IRBuilder::CreateGEP` (which
returns a `Value`). `IRBuilder` can fold and return a `ConstantExpr`
instead, thus violating the assertion. The patch fixes this by using
`GetElementPtrInst::Create` to always return a `GetElementPtrInst`.
This LLVM defect was identified via the AMD Fuzzing project.1 parent e52cddc commit 56beac9
File tree
2 files changed
+22
-5
lines changed- llvm
- lib/Target/SPIRV
- test/CodeGen/SPIRV
2 files changed
+22
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2834 | 2834 | | |
2835 | 2835 | | |
2836 | 2836 | | |
2837 | | - | |
2838 | 2837 | | |
2839 | 2838 | | |
2840 | | - | |
2841 | | - | |
2842 | | - | |
2843 | | - | |
| 2839 | + | |
| 2840 | + | |
| 2841 | + | |
2844 | 2842 | | |
2845 | 2843 | | |
2846 | 2844 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
0 commit comments