Commit d9bc84b
committed
Fix segfault in DComputeSemanticAnalyser::visit(VarDeclaration)
Guard against decl->type being null when semantic analysis
encounters VarDeclarations from failed template instantiations
in imported modules.
When a @compute module imports a template via -I and uses
__traits(compiles, ...) to test it, the recursive walker may
visit VarDeclaration nodes whose type field is null. The
unconditional dereference of decl->type on the check for
Taarray/Tclass causes a segmentation fault.
Fixes #5027.1 parent 6143d88 commit d9bc84b
3 files changed
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
95 | 98 | | |
96 | 99 | | |
97 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments