enable most tnewruntime_strutils tests

This commit is contained in:
Araq
2019-04-10 15:49:04 +02:00
parent 26fc7d465a
commit bc50795d9c
2 changed files with 27 additions and 37 deletions

View File

@@ -86,7 +86,7 @@ proc resize(old: int): int {.inline.} =
else: result = old * 3 div 2 # for large arrays * 3/2 is better
proc prepareAdd(s: var NimStringV2; addlen: int) {.compilerRtl.} =
if isLiteral(s):
if isLiteral(s) and addlen > 0:
let oldP = s.p
# can't mutate a literal, so we need a fresh copy here:
let allocator = getLocalAllocator()