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

addressing ref objects and comparing the pointer address in vm give FieldDefect #19909

Closed
ringabout opened this issue Jun 19, 2022 · 0 comments · Fixed by #19902
Closed

addressing ref objects and comparing the pointer address in vm give FieldDefect #19909

ringabout opened this issue Jun 19, 2022 · 0 comments · Fixed by #19902
Labels
VM see also `const` label

Comments

@ringabout
Copy link
Member

type
  SinglyLinkedList[T] = ref object

proc addMoved[T](a, b: var SinglyLinkedList[T]) =
  if a.addr != b.addr: discard

proc main =
  var a: SinglyLinkedList[int]; new a
  var b: SinglyLinkedList[int]; new b
  a.addMoved b

static: main()

gives

field 'node' is not accessible for type 'TFullReg' using 'kind = rkRegisterAddr' [FieldDefect]

Nim version: 1.6.6/devel

I found the issue while working on #19902

@ringabout ringabout changed the title addressing ref objects and compare the pointer address in vm gives FieldDefect addressing ref objects and comparing the pointer address in vm gives FieldDefect Jun 19, 2022
@ringabout ringabout changed the title addressing ref objects and comparing the pointer address in vm gives FieldDefect addressing ref objects and comparing the pointer address in vm give FieldDefect Jun 19, 2022
@ringabout ringabout added the VM see also `const` label label Jun 19, 2022
ringabout added a commit that referenced this issue Jun 20, 2022
Araq pushed a commit that referenced this issue Jun 22, 2022
 (#19902) [backport]

* revert #12217 since the root problem seems to have been fixed; fix #15974;fix #12551; fix #19464

* fix #16020; fix #16780

* fix tests and #16613

* fix #14553

* fix #19909; skip skipRegisterAddr

* fix #18641
narimiran pushed a commit that referenced this issue Jun 23, 2022
 (#19902) [backport]

* revert #12217 since the root problem seems to have been fixed; fix #15974;fix #12551; fix #19464

* fix #16020; fix #16780

* fix tests and #16613

* fix #14553

* fix #19909; skip skipRegisterAddr

* fix #18641

(cherry picked from commit 3cb2d7a)
capocasa pushed a commit to capocasa/Nim that referenced this issue Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
VM see also `const` label
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant