Fix aflLoop for non afl-clang-fast

This commit is contained in:
kdeme 2019-10-09 21:23:22 +02:00
parent f1604ca929
commit 4b154e56c7
No known key found for this signature in database
GPG Key ID: 4E8DD21420AF43F5
1 changed files with 5 additions and 2 deletions

View File

@ -88,7 +88,10 @@ when defined(clangfast):
## Test case should be able to handle repeated inputs. No repeated fork() will
## be done.
# TODO: Lets use this in the test block when afl-clang-fast is used?
proc aflLoop*(count: cuint): cint {.importc: "__AFL_LOOP", noDecl.}
proc aflLoopImpl(count: cuint): cint {.importc: "__AFL_LOOP", noDecl.}
template aflLoop*(body: untyped): untyped =
while aflLoopImpl(1000) != 0:
`body`
else:
proc aflInit*() = discard
proc aflLoop*(count: cuint): cint = 0
template aflLoop*(body: untyped): untyped = `body`