[flang] add attribute to trim runtime implementation establish call
CFI allocatable attribute is needed so that the descriptor for the result can be allocated/deallocated. Reviewed By: klausler Differential Revision: https://reviews.llvm.org/D97395
This commit is contained in:
parent
c1706f2269
commit
b146dfe527
|
@ -686,7 +686,8 @@ void RTNAME(Trim)(Descriptor &result, const Descriptor &string,
|
|||
terminator.Crash(
|
||||
"TRIM: bad string type code %d", static_cast<int>(string.raw().type));
|
||||
}
|
||||
result.Establish(string.type(), resultBytes, nullptr, 0);
|
||||
result.Establish(string.type(), resultBytes, nullptr, 0, nullptr,
|
||||
CFI_attribute_allocatable);
|
||||
RUNTIME_CHECK(terminator, result.Allocate(nullptr, nullptr) == CFI_SUCCESS);
|
||||
std::memcpy(result.OffsetElement(), string.OffsetElement(), resultBytes);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue