enable optimization for Nim devel

This commit is contained in:
Antonis Geralis 2022-09-03 18:52:43 +03:00
parent 6e78f5c8a3
commit 2c9a7a85d5
1 changed files with 4 additions and 1 deletions

View File

@ -573,7 +573,10 @@ template mutatorImpl*(target, mutator, typ: untyped) =
if data.len > 1:
#var pos = 1
#fromData(data, pos, x)
x = getInput(x, data)
when (NimMajor, NimMinor, NimPatch) >= (1, 7, 1):
x = move getInput(x, data)
else:
x = getInput(x, data)
FuzzMutator(mutator)(x, maxLen-x.byteSize, r)
result = x.byteSize+1 # +1 for the skipped byte
if result <= maxLen: