Commit b89f46f
Both GetElementPtrConstantExpr and GetElementPtrInst may represent access to a buildin variable (#2487)
This PR is to fix the issue when SPIRV Translator expects now to see exactly GetElementPtrInst in an access chain for a builtin variable and crashes in lib/SPIRV/SPIRVUtil.cpp in replaceUsesOfBuiltinVar() with llvm_unreachable() call. See #2486 for the detailed description. Attached is a test case that demonstrates the problem and leads to a crash in current version(s) of SPIRV Translator.
Original commit:
KhronosGroup/SPIRV-LLVM-Translator@a7051670770f4711 parent 3caac02 commit b89f46f
2 files changed
+59
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
| |||
1980 | 1981 | | |
1981 | 1982 | | |
1982 | 1983 | | |
1983 | | - | |
| 1984 | + | |
1984 | 1985 | | |
1985 | 1986 | | |
1986 | 1987 | | |
1987 | 1988 | | |
1988 | 1989 | | |
1989 | | - | |
| 1990 | + | |
| 1991 | + | |
1990 | 1992 | | |
1991 | 1993 | | |
1992 | 1994 | | |
| |||
| 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 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
0 commit comments