21 Commits

Author SHA1 Message Date
gtsoul-tech
8fc1a7efff
Bug fix/clang tidy warnings part2 (#296)
* core.StackAddressEscape

* cplusplus.VirtualCall

* clang-analyzer-deadcode.DeadStores

* clang-analyzer-core.NullDereference

* clang-analyzer-core.NonNullParamChecker

* change to nolint

---------

Co-authored-by: gtsoul-tech <gtsoulkanakis@gmail.com>
2024-06-04 16:18:17 +03:00
Konstantinos Margaritis
9ee4c07964 Fix false positive duplicateAssignExpression warnings 2024-05-11 23:13:45 +03:00
Hong, Yang A
c6523453d7 scratch: remove quick validity check
Roll back fix for github issue #350

About Scratch Usage:
For compile time, scratch space is strongly recommended to be
allocated immediately after database generation.
For runtime, besides using scratch for corresponding database,
Hyperscan also allows user to use larger scratch space allocated
for another database.
When multiple concurrent threads need to use the same databases
and a new scratch space is required, cloning the largest one is
always safe. This is realized based on API hs_scratch_size() and
hs_clone_scratch().
Behaviors beyond above are discouraged and results are undefined.
2023-09-05 13:58:17 +03:00
Hong, Yang A
7f2f7d2a1e scratch: add quick validity check
fix github issue #350
2023-09-05 13:51:15 +03:00
Wang, Xiang W
49592833a7 Scratch: fix scratch free issue when memory allocation fails
Fixes github issue #174
2019-08-13 14:52:21 +08:00
Hong, Yang A
23e5f06594 add new Literal API for pure literal expressions:
Design compile time api hs_compile_lit() and hs_compile_lit_multi()
to handle pure literal pattern sets. Corresponding option --literal-on
is added for hyperscan testing suites. Extended parameters and part of
flags are not supported for this api.
2019-08-13 14:51:38 +08:00
Hong, Yang A
f68723a606 literal matching: separate path for pure literal patterns 2019-01-21 09:59:22 +08:00
Wang, Xiang W
86c5f7feb1 FDR: Squash buckets of included literals in FDR confirm
- Change the compile of literal matchers to two passes.
 - Reverse the bucket assignment in FDR, bucket with longer literals has
   smaller bucket id.
 - Squash the buckets of included literals and jump to the the program of
   included literals directly from parent literal program without going
   through FDR confirm for included iterals.
2017-08-21 11:12:36 +10:00
Matthew Barr
dba2470ec9 msvc: use the vectorcall calling convention
This requires declaring external interfaces with the cdecl
calling convention.
2017-06-09 10:12:02 +10:00
Justin Viiret
e271781d95 multibit, fatbit: make _size build-time only
This commit makes mmbit_size() and fatbit_size compile-time only, and
adds a resource limit for very large multibits.
2016-12-14 15:28:54 +11:00
Alex Coyte
a8aa2d022f Provide access to scratch in queues
This largely reverts commit f8ecf33236b0695d9539e8e34cf0bb0467614cdf.
2016-07-08 10:46:50 +10:00
Justin Viiret
73610c0b64 scratch: don't leave in use after hs_clone_scratch
Also updated unit tests to always check hs_alloc_scratch()'s return
value.
2016-05-18 16:28:03 +10:00
Justin Viiret
c12b953131 runtime: add error for "scratch in use"
This commit adds the HS_SCRATCH_IN_USE error, which is returned when
Hyperscan detects that a scratch region is already in use on entry to an
API function.
2016-05-18 16:27:29 +10:00
Justin Viiret
67b9784dae Rose: use program for all literal matches
Unifies all literal match paths so that the Rose program is used for all
of them. This removes the previous specialised "direct report" and
"multi direct report" paths. Some additional REPORT instruction work was
necessary for this.

Reworked literal construction path at compile time in prep for using
program offsets as literal IDs.

Completely removed the anchored log runtime, which is no longer worth
the extra complexity.
2016-04-20 13:34:54 +10:00
Justin Viiret
c3860a9f29 NFA API: Remove unused scratch ptr from struct mq 2016-03-01 11:34:38 +11:00
Justin Viiret
3e002f8181 NFA: Move NFAContext to stack (from scratch) 2016-03-01 11:34:38 +11:00
Justin Viiret
755e6700c1 scratch: correctly align fatbit arrays
This fixes an assertion failure on 32-bit targets.
2016-03-01 11:27:29 +11:00
Justin Viiret
de61b32e98 Use fatbit for anch log, delay slots in scratch
Since these structures are in scratch, they do not have to be as small
as possible and we can use fatbit instead of multibit to improve
performance.
2016-03-01 11:24:17 +11:00
Justin Viiret
d67c7583ea rose: Extend the interpreter to handle more work
- Use program for EOD sparse iterator
- Use program for literal sparse iterator
- Eliminate RoseRole, RosePred, RoseVertexProps::role
- Small performance optimizations
2016-03-01 11:16:02 +11:00
Alex Coyte
a7d8dafb71 detach the sidecar 2016-03-01 11:13:23 +11:00
Matthew Barr
904e436f11 Initial commit of Hyperscan 2015-10-20 09:13:35 +11:00