Commit 9554152
[flang][OpenMP] Avoid analyzing assumed-size array bases (llvm#150324)
A check for character substrings masquerading as array sections was
using expression analyzer on the array base. When this array happened to
be an assumed-size array, the analyzer emitted a semantic error that did
not correspond to any issue with the source code.
To avoid that, check whether the object is an assumed-size array before
using the expression analyzer on it.
While at it, replace the call to GetShape with a simple check for rank,
since that's the only information needed.
Fixes llvm#150297
(cherry picked from commit 8fcbd06)1 parent 704f542 commit 9554152
File tree
2 files changed
+45
-16
lines changed- flang
- lib/Semantics
- test/Semantics/OpenMP
2 files changed
+45
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
| |||
4117 | 4116 | | |
4118 | 4117 | | |
4119 | 4118 | | |
4120 | | - | |
4121 | | - | |
4122 | | - | |
4123 | | - | |
4124 | | - | |
4125 | | - | |
4126 | | - | |
4127 | | - | |
4128 | | - | |
4129 | | - | |
4130 | | - | |
4131 | | - | |
4132 | | - | |
4133 | | - | |
4134 | | - | |
| 4119 | + | |
| 4120 | + | |
| 4121 | + | |
| 4122 | + | |
| 4123 | + | |
| 4124 | + | |
| 4125 | + | |
| 4126 | + | |
| 4127 | + | |
| 4128 | + | |
| 4129 | + | |
| 4130 | + | |
| 4131 | + | |
| 4132 | + | |
| 4133 | + | |
| 4134 | + | |
| 4135 | + | |
| 4136 | + | |
| 4137 | + | |
| 4138 | + | |
4135 | 4139 | | |
4136 | 4140 | | |
4137 | 4141 | | |
| |||
| 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 | + | |
0 commit comments