diff options
author | Araq <rumpf_a@web.de> | 2019-04-10 13:53:47 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2019-04-10 13:53:47 +0200 |
commit | a34ce2714a11595808cd8421636a89f44c1feb7b (patch) | |
tree | 4b8da00341c33ddb77fb76b14a705497ed7bb75b /lib/core | |
parent | 28b4db447041207bcc4333c1d6bfa8031e79ebf3 (diff) | |
download | Nim-a34ce2714a11595808cd8421636a89f44c1feb7b.tar.gz |
newruntime: fixes another bug
Diffstat (limited to 'lib/core')
-rw-r--r-- | lib/core/seqs.nim | 2 | ||||
-rw-r--r-- | lib/core/strs.nim | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/lib/core/seqs.nim b/lib/core/seqs.nim index 7eb2afe17..a79f0c2f5 100644 --- a/lib/core/seqs.nim +++ b/lib/core/seqs.nim @@ -104,7 +104,7 @@ proc newSeqPayload(cap, elemSize: int): pointer {.compilerRtl, raises: [].} = proc prepareSeqAdd(len: int; p: pointer; addlen, elemSize: int): pointer {. compilerRtl, noSideEffect, raises: [].} = {.noSideEffect.}: - if len+addlen <= len: + if addlen <= 0: result = p elif p == nil: result = newSeqPayload(len+addlen, elemSize) diff --git a/lib/core/strs.nim b/lib/core/strs.nim index 767e897c8..49dc59508 100644 --- a/lib/core/strs.nim +++ b/lib/core/strs.nim @@ -171,8 +171,7 @@ proc setLengthStrV2(s: var NimStringV2, newLen: int) {.compilerRtl.} = s.len = newLen proc nimAsgnStrV2(a: var NimStringV2, b: NimStringV2) {.compilerRtl.} = - # self assignment is fine! - #if unlikely(a.p == b.p): return + if a.p == b.p: return if isLiteral(b): # we can shallow copy literals: frees(a) |