Logo

index : blog

---

  • summary
  • about
  • tree
  • log
  • branches
<< path: root/public/blog.git/html/src/fuzzer/basics.jai blob: abdf862192bb9ea7372e74e996339c2b5f5c7086 [raw] [clear marker]

        
0
1
2/** Follow this convention
3
4 #program_export
5 LLVMFuzzerTestOneInput :: (data: *u8, size: s64) -> s32 #c_call {
6 provide_context_and_string(); // Important! Macro!
7
8 ok := test__http_handle_request(src); // `src` stems from the above macro!
9 if ok != true {
10 report_to_llvm("ERROR", src);
11 assert(false);
12 }
13
14 return 0;
15 }
16
17*/
18
19
20report_to_llvm :: (prefix: string, msg: string) {
21 write_string("---------------------\n");
22 write_string(prefix);
23 write_string(": »");
24 write_string(msg);
25 write_string("«\n");
26}
27
28provide_context_and_string :: () #expand {
29 ctx: #Context;
30 `push_context,defer_pop ctx;
31
32 `src: string = ---;
33 `src.data = `data;
34 `src.count = `size;
35}
36
37
Copyright 2026  E766CB298A6D1E64 | Git-Thing heavily inspired by cgit