follow up #20109; remove shallow seqs/strings for ORC (#20502)

* remove `shallow` seqs/strings for ORC

* add a changelog item

* change url of DelaunayNim
This commit is contained in:
ringabout 2022-10-06 13:16:50 +08:00 • committed by GitHub
commit 723a71bd22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 36 additions and 45 deletions

View file

@ -175,12 +175,14 @@ when not defined(nimseqsv2):
var emptySeq: seq[int] = newSeq[int]()
block:
var t = @[1,2,3]
shallow(nilSeq)
when defined(gcRefc):
shallow(nilSeq)
t = nilSeq
doAssert t == @[]
block:
var t = @[1,2,3]
shallow(emptySeq)
when defined(gcRefc):
shallow(emptySeq)
t = emptySeq
doAssert t == @[]
block:

View file

@ -10,8 +10,8 @@ proc initBytesRange*(s: var Bytes, ibegin = 0, iend = -1): BytesRange =
let e = if iend < 0: s.len + iend + 1
else: iend
assert ibegin > 0 and e <= s.len
shallow(s)
when defined(gcRefc):
shallow(s)
result.bytes = s
result.ibegin = ibegin
result.iend = e

View file

@ -14,8 +14,8 @@ proc initBytesRange*(s: var Bytes, ibegin = 0, iend = -1): BytesRange =
let e = if iend < 0: s.len + iend + 1
else: iend
assert ibegin >= 0 and e <= s.len
shallow(s)
when defined(gcRefc):
shallow(s)
result.bytes = s
result.ibegin = ibegin
result.iend = e

View file

@ -18,7 +18,8 @@ block: # setLen
block: # forceCopy
var a: string
a = "foo"
shallow(a)
when defined(gcRefc):
shallow(a)
var b: string
b = a
doAssert b[0].addr == a[0].addr

View file

@ -26,7 +26,8 @@ when true:
# casting an empty string as sequence with shallow() should not segfault
var s2: string
shallow(s2)
when defined(gcRefc):
shallow(s2)
s2 &= "foo"
doAssert s2 == "foo"