Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 7 commits into from
Nov 4, 2022

Conversation

bung87
Copy link
Collaborator

@bung87 bung87 commented Nov 2, 2022

after 58f79e7 is cgen error error: ‘T3_’ is a pointer; did you mean to use ‘->’? 169 | T3_.x = (*colontmpD_);

Fix #18079

@bung87
Copy link
Collaborator Author

bung87 commented Nov 3, 2022

now destructor error on cpp

/home/bung/.cache/nim/t18079_d/@mt18079.nim.cpp: In function ‘void eqdestroy___t4956485557_70(tyObject_Bar__eflPCCzoX9bl7IHJGyNKvdQ*&)’:
/home/bung/.cache/nim/t18079_d/@mt18079.nim.cpp:187:31: error: invalid initialization of reference of type ‘tyObject_Bar__eflPCCzoX9bl7IHJGyNKvdQ&’ from expression of type ‘tyObject_Bar__eflPCCzoX9bl7IHJGyNKvdQ*’
  187 | {  eqdestroy___t4956485557_58(dest);
      |                               ^~~~
/home/bung/.cache/nim/t18079_d/@mt18079.nim.cpp:181:98: note: in passing argument 1 of ‘void eqdestroy___t4956485557_58(tyObject_Bar__eflPCCzoX9bl7IHJGyNKvdQ&)’
  181 | N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___t4956485557_58)(tyObject_Bar__eflPCCzoX9bl7IHJGyNKvdQ& dest) {
      |                                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~

@bung87
Copy link
Collaborator Author

bung87 commented Nov 4, 2022

CI nim-lang.Nim failed 17, before is 18, however tests/arc/tcaseobj.nim c and tests/arc/tcaseobjcopy.nim c show memory leak.

@Araq Araq merged commit ecc8f61 into nim-lang:devel Nov 4, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2022

Thanks for your hard work on this PR!
The lines below are statistics of the Nim compiler built from ecc8f61

Hint: mm: orc; opt: speed; options: -d:release
164638 lines; 10.462s; 613.945MiB peakmem

capocasa pushed a commit to capocasa/Nim that referenced this pull request Mar 31, 2023
…ref/deref (nim-lang#20738)

* add test case
* refactoring transformAddrDeref and fix nim-lang#18079
* fix jsgen
narimiran pushed a commit that referenced this pull request Apr 25, 2023
#20738)

* add test case
* refactoring transformAddrDeref and fix #18079
* fix jsgen

(cherry picked from commit ecc8f61)
narimiran pushed a commit that referenced this pull request Apr 25, 2023
#20738)

* add test case
* refactoring transformAddrDeref and fix #18079
* fix jsgen

(cherry picked from commit ecc8f61)
bung87 added a commit to bung87/Nim that referenced this pull request Jul 29, 2023
…ref/deref (nim-lang#20738)

* add test case
* refactoring transformAddrDeref and fix nim-lang#18079
* fix jsgen
Araq pushed a commit that referenced this pull request Oct 25, 2024
…24335)

fixes #18081;
fixes #18080
fixes #18079

reverts #20738

It is probably more reasonable to use the type node from `nkObjConstr`
since it is barely changed unlike the external type, which is
susceptible to code transformation e.g. `addr(deref objconstr)`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Illegal storage access compiling call with nested ref/deref'd types
2 participants