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 #15005; [ARC] Global variable declared in a block is destroyed too… #22388

Merged
merged 2 commits into from
Aug 6, 2023

Conversation

bung87
Copy link
Collaborator

@bung87 bung87 commented Aug 5, 2023

… early

fix #15005.

now expand as below.

--expandArc: test

var
  b15005
  a15005`gensym0
var alreadyExecuted`gensym1 = false
if not alreadyExecuted`gensym1:
  alreadyExecuted`gensym1 = true
  `=sink`(a15005`gensym0, T(data: "hi"))
`=copy`(b15005, a15005`gensym0)
const
  loc`gensym3 = (filename: "t15005.nim", line: 15, column: 2)
  ploc`gensym3 = "t15005.nim(15, 3)"
bind instantiationInfo
mixin failedAssertImpl
{.line: (filename: "t15005.nim", line: 15, column: 2).}:
  if not (b15005.data == "hi"):
    failedAssertImpl("t15005.nim(15, 3) `b15005.data == \"hi\"` ")
`=destroy`(b15005)
-- end of expandArc ------------------------

@bung87 bung87 changed the title fix #15005 [ARC] Global variable declared in a block is destroyed too… fix #15005; [ARC] Global variable declared in a block is destroyed too… Aug 5, 2023
@bung87 bung87 requested a review from Araq August 6, 2023 05:49
@bung87 bung87 merged commit 95c751a into nim-lang:devel Aug 6, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Aug 6, 2023

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

Hint: mm: orc; opt: speed; options: -d:release
168494 lines; 8.789s; 611.668MiB peakmem

@bung87 bung87 deleted the fix-15005 branch August 29, 2023 15:53
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.

[ARC] Global variable declared in a block is destroyed too early
3 participants