Fix #18079 Illegal storage access compiling call with nested ref/deref (#20738)

* add test case
* refactoring transformAddrDeref and fix #18079
* fix jsgen
This commit is contained in:
Bung 2022-11-04 16:54:45 +08:00 • committed by GitHub
commit ecc8f61fe4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 38 additions and 9 deletions

11
tests/misc/t18079.nim Normal file
View file

@ -0,0 +1,11 @@
type
Foo = object
y: int
Bar = object
x: Foo
proc baz(state: var Bar):int =
state.x.y = 2
state.x.y
doAssert baz((ref Bar)(x: (new Foo)[])[]) == 2