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

sink usage crashes with literals (refc) #22175

Closed
arnetheduck opened this issue Jun 27, 2023 · 0 comments
Closed

sink usage crashes with literals (refc) #22175

arnetheduck opened this issue Jun 27, 2023 · 0 comments
Labels

Comments

@arnetheduck
Copy link
Contributor

arnetheduck commented Jun 27, 2023

Description

type Xxx = object
  value: string

proc complete(xxx: ref Xxx, v: sink string) =
  xxx.value = move(v)

let yyy = (ref Xxx)()

yyy.complete("test")

Nim Version

1.6.12, devel (refc)

Current Output

testit.nim(57) testit
testit.nim(53) complete
Nim/lib/system/gc.nim(286) asgnRef
Nim/lib/system/gc.nim(231) incRef
Nim/lib/system/arithmetics.nim(407) pluspercent
Nim/lib/system/excpt.nim(631) signalHandler
SIGSEGV: Illegal storage access. (Attempt to read from nil?)

Expected Output

no crash (this is obviously a reduced example)

Possible Solution

No response

Additional Information

No response

@ringabout ringabout changed the title sink usage crashes with literals sink usage crashes with literals (refc) Jun 30, 2023
Araq added a commit that referenced this issue Jul 6, 2023
@Araq Araq closed this as completed in a15db5d Jul 6, 2023
@Araq Araq added the Status label Jul 10, 2023
bung87 pushed a commit to bung87/Nim that referenced this issue Jul 29, 2023
narimiran pushed a commit that referenced this issue Sep 14, 2023
(cherry picked from commit a15db5d)
narimiran pushed a commit that referenced this issue Nov 15, 2023
(cherry picked from commit a15db5d)
narimiran pushed a commit that referenced this issue Dec 1, 2023
(cherry picked from commit a15db5d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants