trying to reuse the buffer results in even more move bugs

maybe we should decommision cache and only work on one variable.
This commit is contained in:
Antonis Geralis 2022-09-08 23:54:14 +03:00
parent 89defc4ab3
commit 56fb715ce7
1 changed files with 4 additions and 0 deletions

View File

@ -585,6 +585,8 @@ template mutatorImpl*(target, mutator, typ: untyped) =
result = cached
else:
var pos = 1
#when (NimMajor, NimMinor, NimPatch) >= (1, 7, 1):
#x = move cached
fromData(data, pos, x)
result = x
@ -596,6 +598,8 @@ template mutatorImpl*(target, mutator, typ: untyped) =
x = cached
else:
var pos = 1
#when (NimMajor, NimMinor, NimPatch) >= (1, 7, 1):
#x = move cached
fromData(data, pos, x)
proc setInput(x: var typ; data: openArray[byte]; len: int) {.inline.} =