diff options
author | jeanPerier <jperier@nvidia.com> | 2024-04-08 10:22:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-08 10:22:44 +0200 |
commit | 6a7da2e30dc38ba92875bfe1da5520c950bab1e3 (patch) | |
tree | 2c30d6b842c1360765dbd8ea743344bc2560021c /clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp | |
parent | 0bfea40101c10f80ee35d7fbfd4459e98cdb289c (diff) | |
download | llvm-6a7da2e30dc38ba92875bfe1da5520c950bab1e3.zip llvm-6a7da2e30dc38ba92875bfe1da5520c950bab1e3.tar.gz llvm-6a7da2e30dc38ba92875bfe1da5520c950bab1e3.tar.bz2 |
[flang] Fix source allocation to explicit length after deferred length object (#87785)
Flang supports source allocation to allocatable or pointers with a non
deferred length that do not match the source length. This documented at:
https://github.com/llvm/llvm-project/blob/9708d0900311503aa4685d6810d8caf0412e15d7/flang/docs/Extensions.md?plain=1#L312
The current lowering code was bugged when such explicit length allocate
object appeared after a deferred length object in the source allocation
list:
Since "lenParams" had been computed when generating allocation of the
deferred length object, the call to genSetDeferredLengthParameters was
not a no-op on when lowering the explicit length allocation, and the
explicit length was overridden with the source length.
The output of the program added in test was:
```
ZZheZZ
ZZhelloZZ
ZZhelloZZ
```
Instead of:
```
ZZheZZ
ZZhelloZZ
ZZhello ZZ
```
Skip genSetDeferredLengthParameters when the allocate object has non
deferred length.
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp')
0 files changed, 0 insertions, 0 deletions