mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-11 20:27:19 +00:00
![Slava Zakharin](/assets/img/avatar_default.png)
The TODO was left there to verify that Assign() runtime handles overlaps of allocatable components. It did not, and this change-set fixes it. Note that the same Assign() issue can be reproduced without HLFIR. In the following example the LHS would be reallocated before value of RHS (essentially, the same memory) is read: ``` program main type t1 integer, allocatable :: a(:) end type t1 type(t1) :: x, y allocate(x%a(10)) do i =1,10 x%a(i) = 2*i end do x = x print *, x%a deallocate(x%a) end program main ``` The test's output would be incorrect (though, this depends on the memory reuse by malloc): 0 0 0 0 10 12 14 16 18 20 It is very hard to add a Flang unittest exploiting derived types. Reviewed By: klausler Differential Revision: https://reviews.llvm.org/D152306