-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(deps): Bump hs-tokstyle from
636ca43
to f640e80
Bumps [hs-tokstyle](https://github.com/TokTok/hs-tokstyle) from `636ca43` to `f640e80`. - [Release notes](https://github.com/TokTok/hs-tokstyle/releases) - [Commits](TokTok/hs-tokstyle@636ca43...f640e80) --- updated-dependencies: - dependency-name: hs-tokstyle dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
- Loading branch information
1 parent
60b6095
commit 6980e85
Showing
9 changed files
with
131 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule hs-tokstyle
updated
14 files
+29 −1 | doc/cimple.md | |
+7 −0 | doc/generate | |
+2 −0 | src/Tokstyle/C/Linter.hs | |
+68 −0 | src/Tokstyle/C/Linter/SizeArg.hs | |
+15 −3 | src/Tokstyle/C/Patterns.hs | |
+12 −0 | src/Tokstyle/Common.hs | |
+2 −0 | src/Tokstyle/Linter.hs | |
+20 −5 | src/Tokstyle/Linter/CallocArgs.hs | |
+14 −1 | src/Tokstyle/Linter/CallocType.hs | |
+117 −0 | src/Tokstyle/Linter/MallocCall.hs | |
+40 −17 | src/Tokstyle/Linter/MallocType.hs | |
+189 −0 | test/Tokstyle/C/Linter/SizeArgSpec.hs | |
+53 −0 | test/Tokstyle/Linter/MallocCallSpec.hs | |
+4 −0 | tokstyle.cabal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env python3 | ||
import re | ||
import subprocess | ||
import sys | ||
|
||
SYMBOLIZER = ( | ||
"/nix/store/d0r6r274cpcr6gslqx16gn0m38qpy5p3-llvm-16.0.6/bin/llvm-symbolizer" | ||
) | ||
|
||
for line in sys.stdin: | ||
m = re.fullmatch( | ||
"#(\d+) (0x[0-9a-f]+) \((.*)\+(0x[0-9a-f]+)\)( \(BuildId: [0-9a-f]+\))?", | ||
line.strip(), | ||
) | ||
if m: | ||
num = m.group(1) | ||
addr = m.group(2) | ||
prog = m.group(3) | ||
off = m.group(4) | ||
buildid = m.group(5) or "" | ||
|
||
try: | ||
fun = (subprocess.run( | ||
[SYMBOLIZER, "--pretty-print", f"--exe={prog}", off], | ||
check=True, | ||
capture_output=True, | ||
).stdout.decode("utf-8").split("\n")[0]) | ||
print(f" #{num} {fun}") | ||
except subprocess.CalledProcessError: | ||
print(f" #{num} {addr} ({prog}+{off}){buildid}") | ||
else: | ||
print(line, end="") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#!/usr/bin/env python3 | ||
import glob | ||
import os | ||
import subprocess | ||
import sys | ||
|
||
CLEANUP = True | ||
SELF_DIR = os.path.dirname(os.path.abspath(__file__)) | ||
TMP_CORPUS = "/tmp/fuzzing/corpus/" | ||
|
||
|
||
def update_corpus(target: str, corpus: str) -> None: | ||
with open(os.path.join(corpus, "bootstrap"), "w"): | ||
# Touch one file so the corpus isn't empty. | ||
pass | ||
subprocess.run( | ||
[ | ||
"bazel", | ||
"run", | ||
"--config=asan-libfuzzer", | ||
target + "_run", | ||
"--", | ||
"--timeout_secs=30", | ||
], | ||
check=True, | ||
) | ||
for file in glob.glob(os.path.join(corpus, "*")): | ||
if os.path.basename(file) != "bootstrap": | ||
subprocess.run(["mv", file, TMP_CORPUS], check=True) | ||
subprocess.run( | ||
[ | ||
"bazel", | ||
"run", | ||
"--config=asan-libfuzzer", | ||
target + "_bin", | ||
"--", | ||
"-merge=1", | ||
corpus, | ||
TMP_CORPUS, | ||
], | ||
check=True, | ||
) | ||
if CLEANUP: | ||
for file in glob.glob(os.path.join(TMP_CORPUS, "*")): | ||
os.remove(file) | ||
|
||
|
||
def main() -> None: | ||
if len(sys.argv) > 1: | ||
query = " ".join(sys.argv[1:]) | ||
else: | ||
query = "//c-toxcore/..." | ||
targets = (subprocess.run( | ||
["bazel", "query", f"kind(fuzzing_regression_test, {query})"], | ||
check=True, | ||
capture_output=True, | ||
).stdout.decode("utf-8").strip().split("\n")) | ||
|
||
for target in targets: | ||
name = target.split(":")[1] | ||
corpus = os.path.join(SELF_DIR, "toktok-fuzzer", "corpus", name) | ||
if os.path.exists(corpus): | ||
update_corpus(target, corpus) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
Submodule toktok-fuzzer
updated
8282 files