Skip to content

Commit

Permalink
llamacpp: fix fuzzers (#12618)
Browse files Browse the repository at this point in the history
Signed-off-by: David Korczynski <[email protected]>
  • Loading branch information
DavidKorczynski authored Oct 19, 2024
1 parent 97de184 commit 4e5e6bf
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions projects/llamacpp/fuzzers/fuzz_tokenizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,8 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
common_tokenize(ctx, payload.c_str(), add_special, parse_special);
common_detokenize(ctx, tokens);

auto n_past = 0;
if (setjmp(fuzzing_jmp_buf) == 0) {
llama_decode(ctx, llama_batch_get_one(tokens.data(), tokens.size(), n_past, 0));
llama_decode(ctx, llama_batch_get_one(tokens.data(), tokens.size()));
}
} catch (...) {
}
Expand Down

0 comments on commit 4e5e6bf

Please sign in to comment.