newruntime: fixes another bug
This commit is contained in:
parent
28b4db4470
commit
a34ce2714a
5 changed files with 247 additions and 4 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue