Assigning a record-returning method's result back into the same variable that is the receiver (M := M.Method(...)) corrupted the computation: the sret destination buffer aliased Self, so the callee wrote Result (== Self) while still reading Self, clobbering it mid-flight. Affected both backends. Both backends now detect the case where the call's receiver is exactly the destination variable and route the sret call through a fresh zeroed temporary, moving the constructed result into the destination (release old managed fields, raw ownership-transfer memcpy) only after the call returns. Adds an IR unit test (RoutesThroughTemp) and two e2e tests (managed-string field and scalar fields) covering the self-assign and a non-aliasing regression guard. |
||
|---|---|---|
| .. | ||
| src | ||
| project.xml | ||