From 56fb715ce72905f34db38b37d01e0bfa88b9c594 Mon Sep 17 00:00:00 2001 From: Antonis Geralis Date: Thu, 8 Sep 2022 23:54:14 +0300 Subject: [PATCH] trying to reuse the buffer results in even more move bugs maybe we should decommision cache and only work on one variable. --- drchaos/mutator.nim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drchaos/mutator.nim b/drchaos/mutator.nim index 5159db8..0815b3f 100644 --- a/drchaos/mutator.nim +++ b/drchaos/mutator.nim @@ -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.} =