Files
Nim/tests/arc
ringabout 262ff648aa [backport] fixes #23690; SIGSEGV with object variants and RTTI (#23703)
fixes #23690

```nim
dest.`:state` = src.`:state`
var :tmp_553651276 = dest.e1.a
`=wasMoved`(dest.e1.a)
dest.e1.a.kind = src.e1.a.kind
case dest.e1.a.kind
of 0:
  dest.e1.a.a = src.e1.a.a
of 1:
  `=copy`(dest.e1.a.c, src.e1.a.c)
case :tmp_553651276.kind
of 0:
of 1:
  `=destroy`(:tmp_553651276.c)
```
`dest.e1.a.kind = src.e1.a.kind` changes the discrimant but it fails to
clear the memory of `dest.e1.a`. Before using hooks for copying, we need
to clear the dest, e.g. `=wasMoved(dest.e1.a.c)`.

```nim
dest.`:state` = src.`:state`
var :tmp_553651276 = dest.e1.a
`=wasMoved`(dest.e1.a)
dest.e1.a.kind = src.e1.a.kind
case dest.e1.a.kind
of 0:
  `=wasMoved`(dest.e1.a.a)
  dest.e1.a.a = src.e1.a.a
  `=wasMoved`(dest.e1.a.b)
of 1:
  `=wasMoved`(dest.e1.a.c)
  `=copy`(dest.e1.a.c, src.e1.a.c)
case :tmp_553651276.kind
of 0:
of 1:
  `=destroy`(:tmp_553651276.c)
```
2024-06-11 05:55:08 +02:00
..
2020-07-07 22:43:36 +02:00
2020-07-07 22:43:36 +02:00
2020-07-10 18:10:32 +02:00
2021-01-20 11:05:56 +01:00
2020-10-12 10:12:32 +01:00
2020-07-07 22:43:36 +02:00
2020-11-12 09:28:32 +01:00
2021-03-04 19:33:16 +01:00
2023-07-06 15:15:50 +02:00
2021-10-29 19:55:48 +02:00
2022-10-02 06:44:10 +02:00
2020-03-09 15:32:38 +01:00
2020-11-26 10:24:52 +01:00
2020-10-19 22:25:43 +02:00
2023-06-30 14:54:46 +02:00
2021-03-06 22:35:02 +01:00
2020-11-26 10:24:52 +01:00
2023-06-02 16:03:32 +02:00
2020-03-09 15:32:38 +01:00
2022-10-17 23:48:51 +02:00
2021-07-13 12:44:29 +02:00
2020-04-22 17:34:35 +02:00
2020-10-19 22:25:43 +02:00
2020-09-11 01:50:42 +02:00
2021-07-27 09:36:19 +02:00
2020-09-20 10:43:57 +02:00
2023-06-27 22:42:48 +02:00
2022-10-01 16:46:51 +02:00
2020-09-24 15:41:45 +02:00
2020-11-09 12:26:12 +01:00
2021-06-25 14:12:23 +02:00
2021-02-08 09:46:07 +01:00
2021-07-13 14:17:59 +02:00
2020-07-04 07:37:24 +02:00
2021-07-27 14:32:56 +02:00