summary refs log tree commit diff stats
path: root/tests/arc/tcaseobj.nim
Commit message (Collapse)AuthorAgeFilesLines
* [backport] fixes #23690; SIGSEGV with object variants and RTTI (#23703)ringabout2024-06-111-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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) ```
* fix #18977; disallow change branch of an object variant in ORC (#21526)ringabout2023-03-161-10/+18
| | | | | | | | | | | * fix #18977 disallow change branch of an object variant in ORC * check errors for goto exception * fixes conditions * fixes tests * add a test case for #18977
* fixes #21023; Segfault when mixing seqs, orc, variants and futures (#21497)ringabout2023-03-101-0/+61
| | | | | | | | | * fixes #21023; Segfault when mixing seqs, orc, variants and futures * fixes none of the branches were explicitly selected * add one more test * one more test
* Add testcase for bug #20305 (#20323)Antonis Geralis2022-09-131-0/+25
| | | | | | | * add testcase for bug #20305 * Update tcaseobj.nim Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
* fixes #15532 (#15534)Andreas Rumpf2020-10-091-0/+21
|
* fix #14312cooldome2020-05-121-2/+13
|
* fixes #14244 (#14248)cooldome2020-05-061-0/+19
| | | Co-authored-by: cooldome <ariabushenko@bk.ru>
* Error -> Defect for defects (#13908)Jacek Sieka2020-04-281-5/+5
| | | | | | | | | | | | | | * Error -> Defect for defects The distinction between Error and Defect is subjective, context-dependent and somewhat arbitrary, so when looking at an exception, it's hard to guess what it is - this happens often when looking at a `raises` list _without_ opening the corresponding definition and digging through layers of inheritance. With the help of a little consistency in naming, it's at least possible to start disentangling the two error types and the standard lib can set a good example here.
* Implements RFCs #209 (#13995)cooldome2020-04-161-0/+49
| | | | | * add test * add changelod entry Co-authored-by: cooldome <ariabushenko@bk.ru>
* ARC: misc bugfixes (#13156)Andreas Rumpf2020-01-151-0/+146
* fixes #13102 * closes #13149 * ARC: fixes a move optimizer bug (there are more left regarding array and tuple indexing) * proper fix; fixes #12957 * fixes yet another case object '=' code generation problem