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 #16384 and #17144 #17126

Merged
merged 12 commits into from
Mar 3, 2021
Merged

fix #16384 and #17144 #17126

merged 12 commits into from
Mar 3, 2021

Conversation

ringabout
Copy link
Member

@ringabout ringabout commented Feb 21, 2021

fix #16384
fix #17144

@ringabout ringabout changed the title fix #16384 [backport] fix #16384 Feb 21, 2021
@ringabout ringabout changed the title [backport] fix #16384 [backport 1.4] fix #16384 Feb 21, 2021
@ringabout ringabout mentioned this pull request Feb 21, 2021
compiler/vmgen.nim Outdated Show resolved Hide resolved
@Araq
Copy link
Member

Araq commented Feb 22, 2021

Why backport? This is not a regression and risky in itself.

@ringabout
Copy link
Member Author

the codes from #16384 works for Nim 1.4.0 but failed at Nim 1.4.2. This PR fix the issue?

@ringabout ringabout changed the title [backport 1.4] fix #16384 fix #16384 Feb 22, 2021
tests/stdlib/tlists.nim Outdated Show resolved Hide resolved
@ringabout ringabout marked this pull request as draft February 23, 2021 12:59
@ringabout ringabout marked this pull request as ready for review March 3, 2021 01:48
@ringabout ringabout requested a review from Araq March 3, 2021 01:55
@timotheecour
Copy link
Member

LGTM after removing the TODO fixme since it now works.

also note for other reviewers that to view the diff, it's best to do it locally after diffing against a file where you indent the whole test inside a template main, then the resulting diff is tiny:

diff --git a/Users/timothee/git_clone//nim//Nim_devel//tests/stdlib/tlists.nim b/tests/stdlib/tlists.nim
index bbce444d5..91afcf4b6 100644
--- a/Users/timothee/git_clone//nim//Nim_devel//tests/stdlib/tlists.nim
+++ b/tests/stdlib/tlists.nim
@@ -2,11 +2,12 @@ discard """
   targets: "c js"
 """

-import lists, sequtils
+import std/[lists, sequtils]

 const
   data = [1, 2, 3, 4, 5, 6]

+
 template main =
   block SinglyLinkedListTest1:
     var L: SinglyLinkedList[int]
@@ -184,7 +185,10 @@ template main =
         doAssert l3.toSeq == [4, 5, 6]
         doAssert l2.toSeq == [1, 2, 3]
         l3.prepend l0
-        doAssert l3.toSeq == [4, 5, 6]
+        when nimvm:
+          # discard # TODO fixme
+        else:
+          doAssert l3.toSeq == [4, 5, 6]
       block:
         var c = [0, 1].toList
         c.prependMoved c

@ringabout ringabout changed the title fix #16384 fix #16384 #17144 Mar 3, 2021
@ringabout ringabout changed the title fix #16384 #17144 fix #16384 and #17144 Mar 3, 2021
@timotheecour
Copy link
Member

I'd be fine with backporting this in its current state, but can be decided later.

compiler/vm.nim Outdated Show resolved Hide resolved
compiler/vm.nim Outdated Show resolved Hide resolved
@Araq Araq merged commit 6391f6e into nim-lang:devel Mar 3, 2021
narimiran pushed a commit that referenced this pull request Mar 18, 2021
(cherry picked from commit 6391f6e)
narimiran pushed a commit that referenced this pull request Mar 18, 2021
(cherry picked from commit 6391f6e)
narimiran pushed a commit that referenced this pull request Mar 18, 2021
(cherry picked from commit 6391f6e)
narimiran pushed a commit that referenced this pull request Mar 18, 2021
(cherry picked from commit 6391f6e)
narimiran pushed a commit that referenced this pull request Mar 18, 2021
(cherry picked from commit 6391f6e)
narimiran pushed a commit that referenced this pull request Mar 18, 2021
(cherry picked from commit 6391f6e)
ringabout added a commit to ringabout/Nim that referenced this pull request Mar 22, 2021
ardek66 pushed a commit to ardek66/Nim that referenced this pull request Mar 26, 2021
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.

prependMoved failed at compile time regression since 1.4.2: vm crash with lists.SinglyLinkedRing
3 participants