Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate PCRE capture handling #12

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
8269df1
include/adt/hash.h: Centralize hashing functions.
silentbicycle Feb 16, 2023
36ed4eb
include/adt/pv.h: Permutation vector building.
silentbicycle Feb 16, 2023
377c67d
Add src/adt/idmap.c, a state -> ID set map.
silentbicycle Feb 16, 2023
41c8e54
Add `fsm_generate_matches` (src/libfsm/gen.c).
silentbicycle Feb 16, 2023
d997649
Complemely rework capture resoultion.
silentbicycle Feb 16, 2023
ef08bab
Bugfix: fsm.c: Set `dst->hasstart` in `fsm_move`.
silentbicycle Feb 16, 2023
7ef4a6c
UBSAN: Add char signedness casts.
silentbicycle Feb 16, 2023
9ed77c7
parser.act: Avoid crash in parser from '(*:'.
silentbicycle Feb 16, 2023
a729833
print/fsm.c: Use u64bitset ADT.
silentbicycle Feb 16, 2023
9089520
ast_rewrite: Make ast_rewrite's ALT case deduplication preserve order.
silentbicycle Feb 16, 2023
f584a9c
Makefiles: use -std=c99
silentbicycle Feb 16, 2023
8b6ce44
lx/parser.act: Disable captures.
silentbicycle Feb 16, 2023
6428f5e
libre/print/tree.c: Add analysis metadata to AST tree printout.
silentbicycle Feb 16, 2023
16676e3
fuzz/target.c: Update fuzz harness with PCRE comparison modes.
silentbicycle Feb 16, 2023
f753c72
re: Add flags for generating input, capture resolution, multi-regexes.
silentbicycle Feb 16, 2023
719acc6
tests/*/Makefile: Add `-FC` (no captures) for some calls to RE.
silentbicycle Feb 16, 2023
efeae03
tests/pcre-anchor/in81.re: Add test for anchoring edge case.
silentbicycle Feb 16, 2023
1f9d673
internedstateset: If EXPENSIVE_CHECKS, add check for sorted input.
silentbicycle Mar 2, 2023
e9c59bc
re_capvm_compile: Extract `compile_kleen_star`, also use for e.g. x{3,}.
silentbicycle Mar 6, 2023
f3e69c3
capture tests: SHOULD_SKIP -> SHOULD_REJECT_AS_UNSUPPORTED
silentbicycle Mar 6, 2023
5badf27
ast_analysis: Implement rejection for e.g. `^(($)|x)+$`.
silentbicycle Mar 6, 2023
0fd0f12
minimise: Add missing call to `INIT_TIMERS()`.
silentbicycle Mar 8, 2023
fddcf6f
ast_analysis: Ensure unuspported code path is flagged as unsatisfiable.
silentbicycle Mar 8, 2023
f39528a
ast_analysis: Correct overly strict assertion.
silentbicycle Mar 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ SUBDIR += src/lx
SUBDIR += src
SUBDIR += tests/capture
SUBDIR += tests/complement
SUBDIR += tests/gen
SUBDIR += tests/idmap
SUBDIR += tests/intersect
SUBDIR += tests/ir
SUBDIR += tests/eclosure
Expand Down
11 changes: 10 additions & 1 deletion fuzz/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ ${BUILD}/fuzz/: ${BUILD}

DIR += ${BUILD}/fuzz

# Uncomment to enable capture fuzzing using PCRE as a test oracle.
#PCRE_CMP=1

.if PCRE_CMP
PKG += libpcre2-8
LFLAGS.fuzzer += ${LIBS.libpcre2-8}
CFLAGS.${SRC:Mfuzz/target.c} += -DPCRE_CMP=1
.endif

.for src in ${SRC:Mfuzz/*.c}
CFLAGS.${src} += -std=c99
.endfor
Expand All @@ -15,7 +24,7 @@ CFLAGS.${src} += -std=c99
fuzz:: ${BUILD}/fuzz/fuzzer

${BUILD}/fuzz/fuzzer: mkdir
${CC} -o $@ ${LFLAGS} ${.ALLSRC:M*.o} ${.ALLSRC:M*.a}
${CC} -o $@ ${LFLAGS} ${LFLAGS.fuzzer} ${.ALLSRC:M*.o} ${.ALLSRC:M*.a}

.for lib in ${LIB:Mlibfsm} ${LIB:Mlibre}
${BUILD}/fuzz/fuzzer: ${BUILD}/lib/${lib:R}.a
Expand Down
9 changes: 7 additions & 2 deletions fuzz/run_fuzzer
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,10 @@ if [ ! -d "${SEEDS}" ]; then
mkdir -p "${SEEDS}"
fi

echo "\n==== ${FUZZER}"
${FUZZER} -jobs=${WORKERS} -workers=${WORKERS} -max_total_time=${SECONDS} ${SEEDS}
if [ -z "${1}" ]; then
echo "\n==== ${FUZZER}"
${FUZZER} -jobs=${WORKERS} -workers=${WORKERS} -max_total_time=${SECONDS} ${SEEDS}
else
xxd "${1}"
${FUZZER} "${1}"
fi
Loading