You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/encoding.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -107,7 +107,7 @@ For each of these encodings, prism provides functions for checking if the subseq
107
107
108
108
## Getting notified when the encoding changes
109
109
110
-
You may want to get notified when the encoding changes based on the result of parsing an encoding comment. We use this internally for our `lex` function in order to provide the correct encodings for the tokens that are returned. For that you can register a callback with `pm_parser_register_encoding_changed_callback`. The callback will be called with a pointer to the parser. The encoding can be accessed through `parser->encoding`.
110
+
You may want to get notified when the encoding changes based on the result of parsing an encoding comment. We use this internally for our `lex` function in order to provide the correct encodings for the tokens that are returned. For that you can register a callback with `pm_parser_encoding_changed_callback_set`. The callback will be called with a pointer to the parser. The encoding can be accessed through `parser->encoding`.
111
111
112
112
```c
113
113
// When the encoding that is being used to parse the source is changed by prism,
Copy file name to clipboardExpand all lines: docs/fuzzing.md
+4-11Lines changed: 4 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,34 +5,29 @@ We use fuzzing to test the various entrypoints to the library. The fuzzer we use
5
5
```
6
6
fuzz
7
7
├── corpus
8
-
│ ├── parse fuzzing corpus for parsing (a symlink to our fixtures)
9
-
│ └── regexp fuzzing corpus for regexp
8
+
│ └── parse fuzzing corpus for parsing (a symlink to our fixtures)
10
9
├── dict a AFL++ dictionary containing various tokens
11
10
├── docker
12
11
│ └── Dockerfile for building a container with the fuzzer toolchain
13
12
├── fuzz.c generic entrypoint for fuzzing
14
13
├── heisenbug.c entrypoint for reproducing a crash or hang
15
14
├── parse.c fuzz handler for parsing
16
15
├── parse.sh script to run parsing fuzzer
17
-
├── regexp.c fuzz handler for regular expression parsing
18
-
├── regexp.sh script to run regexp fuzzer
19
16
└── tools
20
17
├── backtrace.sh generates backtrace files for a crash directory
21
18
└── minimize.sh generates minimized crash or hang files
22
19
```
23
20
24
21
## Usage
25
22
26
-
There are currently three fuzzing targets
23
+
There is currently one fuzz target:
27
24
28
25
-`pm_serialize_parse` (parse)
29
-
-`pm_regexp_parse` (regexp)
30
26
31
-
Respectively, fuzzing can be performed with
27
+
Fuzzing can be performed with
32
28
33
29
```
34
30
make fuzz-run-parse
35
-
make fuzz-run-regexp
36
31
```
37
32
38
33
To end a fuzzing job, interrupt with CTRL+C. To enter a container with the fuzzing toolchain and debug utilities, run
@@ -43,8 +38,6 @@ make fuzz-debug
43
38
44
39
# Out-of-bounds reads
45
40
46
-
Currently, encoding functionality implementing the `pm_encoding_t` interface can read outside of inputs. For the time being, ASAN instrumentation is disabled for functions from src/enc. See `fuzz/asan.ignore`.
47
-
48
41
To disable ASAN read instrumentation globally, use the `FUZZ_FLAGS` environment variable e.g.
49
42
50
43
```
@@ -55,7 +48,7 @@ Note, that this may make reproducing bugs difficult as they may depend on memory
55
48
56
49
```
57
50
make fuzz-debug # enter the docker container with build tools
0 commit comments