diff options
author | Araq <rumpf_a@web.de> | 2019-04-10 15:49:04 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2019-04-10 15:49:04 +0200 |
commit | bc50795d9c43a54db90030dd03f7b3460ccd2df9 (patch) | |
tree | 2f61285ab949c34f6a0b08426ababc2bbee26be3 /lib | |
parent | 26fc7d465a3fe9ba1ad2311810ce4e3c4d2d3a32 (diff) | |
download | Nim-bc50795d9c43a54db90030dd03f7b3460ccd2df9.tar.gz |
enable most tnewruntime_strutils tests
Diffstat (limited to 'lib')
-rw-r--r-- | lib/core/strs.nim | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/core/strs.nim b/lib/core/strs.nim index 49dc59508..b00042dc9 100644 --- a/lib/core/strs.nim +++ b/lib/core/strs.nim @@ -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() |