summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2019-06-20 19:39:42 +0200
committerAndreas Rumpf <rumpf_a@web.de>2019-06-20 19:39:42 +0200
commit280193cc078c8777c6f4465eb141a441ed9d0638 (patch)
treec9f0c2a358afc0036fdf5d04d8812ecfeaacaed0 /lib
parent7e4748beeee3b7fb89801f6fe1e9693423e36f86 (diff)
downloadNim-280193cc078c8777c6f4465eb141a441ed9d0638.tar.gz
[bugfix] system.nim: make pop work with --newruntime
Diffstat (limited to 'lib')
-rw-r--r--lib/system.nim8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/system.nim b/lib/system.nim
index 631124a0f..11c91533c 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -3071,8 +3071,12 @@ proc pop*[T](s: var seq[T]): T {.inline, noSideEffect.} =
     assert a == @[1, 3, 5]
 
   var L = s.len-1
-  result = s[L]
-  setLen(s, L)
+  when defined(nimV2):
+    result = move s[L]
+    shrink(s, L)
+  else:
+    result = s[L]
+    setLen(s, L)
 
 proc `==`*[T: tuple|object](x, y: T): bool =
   ## Generic ``==`` operator for tuples that is lifted from the components.