Commit graph

51 commits

Author SHA1 Message Date
Arne Welzel
93a3a11d36 Merge remote-tracking branch 'origin/topic/vern/script-opt-keep-asserts'
* origin/topic/vern/script-opt-keep-asserts:
  ZAM documentation updates for asserts and event handler run-time errors
  BTest updates for ZAM support of (optionally) keeping "assert" statements
  command-line options for controlling script optimization: keeping asserts, avoiding event handler coalescence
  ZAM support for option to not coalesce event handlers
  ZAM support for keeping "assert" statements
  internal support for script optimization options for keeping asserts, not consolidating event handlers
  ZAM operations to support asserts
  simplified "assert" by not trying to catch messages that themselves have errors

Fixed some TEST-REQUIRES "${ZEEK_ZAM}" == "1" to use "=" instead to
be /bin/sh compatible.
2024-12-05 21:45:07 +01:00
Vern Paxson
0fda589a19 ZAM optimization now removes hook calls to hooks without any bodies 2024-12-03 12:47:20 -07:00
Vern Paxson
908e8a3a27 ZAM support for keeping "assert" statements 2024-12-03 10:37:38 -07:00
Vern Paxson
ff7466df6e minor optimization of boolean comparisons 2024-07-23 16:05:24 -07:00
Arne Welzel
3097a79539 Merge remote-tracking branch 'origin/topic/vern/record-script-opt'
* origin/topic/vern/record-script-opt:
  script optimization for record operations sourced (in part) from other records
2024-06-24 11:19:31 +02:00
Vern Paxson
4b719ef45a script optimization for record operations sourced (in part) from other records 2024-06-24 09:38:37 +02:00
Vern Paxson
37c1f6641c script optimization support for "add" and "delete" being expressions 2024-05-29 12:40:06 -07:00
Vern Paxson
7c8c83efc4 factor script optimization Expr AST nodes out of main AST header 2024-04-25 09:15:13 -07:00
Vern Paxson
5445e8c7ff optimization of scripting idioms - min/max, has-elements 2024-04-25 09:15:12 -07:00
Vern Paxson
6f0441d6f9 fix for ZAM optimization of "while" loops 2024-04-17 14:33:31 -07:00
Vern Paxson
74d36eb759 script optimization support for clearing tables/vectors using "delete" 2024-03-08 19:09:46 +01:00
Vern Paxson
e5bb63c662 fixes & enhancements to location information associated w/ AST nodes & ZAM optimization 2024-02-06 11:03:02 +01:00
Vern Paxson
ce09a11a0c fix for AST analysis of inlined functions 2023-12-04 16:53:32 -08:00
Vern Paxson
087eb1ca4e new method for Stmt nodes to report whether they could execute a "return" 2023-12-04 16:53:32 -08:00
Vern Paxson
b489cfc508 greater ZAM optimization of inlined function calls 2023-11-10 09:57:35 +01:00
Vern Paxson
1dc74eaa9c fixes for a number of ZAM optimization bugs 2023-11-10 09:56:59 +01:00
Vern Paxson
c49918ba8b fixed some warnings about mixing signed & unsigned integers 2023-11-10 09:56:59 +01:00
Benjamin Bannier
f5a76c1aed Reformat Zeek in Spicy style
This largely copies over Spicy's `.clang-format` configuration file. The
one place where we deviate is header include order since Zeek depends on
headers being included in a certain order.
2023-10-30 09:40:55 +01:00
Vern Paxson
3925ff4592 addressed performance and correctness issues flagged by Coverity 2023-08-15 16:07:49 -07:00
Vern Paxson
79c53c9ed6 some code simplifications and streamlining 2023-07-20 09:35:07 -07:00
Vern Paxson
b9949560c6 fixes for ZAM compilation of switch statements 2023-07-17 16:31:30 -07:00
Vern Paxson
cc059f6b51 fix for recent smart pointer change 2023-07-13 11:38:27 -07:00
Vern Paxson
fbdc5e3f29 removed use of unnecessary member variable accessors for StmtList methods 2023-07-11 16:04:30 -07:00
Vern Paxson
1b2cd0c767 migrated some raw pointers to smart pointers 2023-07-11 16:04:30 -07:00
Vern Paxson
1dd2270272 WhenStmt/WhenInfo restructuring in support of ZAM "when" statements 2023-06-30 09:36:14 +02:00
Vern Paxson
4a5a7f975d bug fixes for script optimization intermediate forms 2023-06-30 09:36:14 +02:00
Vern Paxson
5165a04ae0 ZAM ignores new "assert" statement 2023-06-14 17:41:41 -07:00
Arne Welzel
2f1ea789d1 Merge remote-tracking branch 'origin/topic/awelzel/2285-assert-statement'
* origin/topic/awelzel/2285-assert-statement:
  NEWS: Small section about assert statement
  Stmt: Rework assertion hooks break semantics
  Stmt: Introduce assert statement and related hooks
  ZeekArgs: Helper for empty arguments
  Reporter: Allow AssertStmt to throw InterpreterException
  Lift backtrace() code into Func.{h,cc}
2023-06-14 12:51:53 +02:00
Arne Welzel
25ea678626 Stmt: Introduce assert statement and related hooks
including two hooks called assertion_failure() and assertion_result() for
customization and tracking of assertion results.
2023-06-12 18:16:02 +02:00
Tim Wojtulewicz
2739275b88 Merge remote-tracking branch 'jsoref/spelling-src'
* jsoref/spelling-src:
  Spelling src
2022-11-11 12:49:15 -07:00
Tim Wojtulewicz
951250b753 Merge remote-tracking branch 'origin/topic/vern/script-opt-Nov22-maint'
* origin/topic/vern/script-opt-Nov22-maint:
  Script optimization maintenance and updates:   maintenance fixes for variadic run-time checks, '_' placeholder identifier   "-O allow-cond" permits compiling scripts to C++ when influenced by @if conditionals   more robust standalone compile-to-C++ properties   fix for nested "when" statements   test suite updates
2022-11-09 18:24:03 -07:00
Josh Soref
cd201aa24e Spelling src
These are non-functional changes.

* accounting
* activation
* actual
* added
* addresult
* aggregable
* aligned
* alternatively
* ambiguous
* analysis
* analyzer
* anticlimactic
* apparently
* application
* appropriate
* arithmetic
* assignment
* assigns
* associated
* authentication
* authoritative
* barrier
* boundary
* broccoli
* buffering
* caching
* called
* canonicalized
* capturing
* certificates
* ciphersuite
* columns
* communication
* comparison
* comparisons
* compilation
* component
* concatenating
* concatenation
* connection
* convenience
* correctly
* corresponding
* could
* counting
* data
* declared
* decryption
* defining
* dependent
* deprecated
* detached
* dictionary
* directional
* directly
* directory
* discarding
* disconnecting
* distinguishes
* documentation
* elsewhere
* emitted
* empty
* endianness
* endpoint
* enumerator
* essentially
* evaluated
* everything
* exactly
* execute
* explicit
* expressions
* facilitates
* fiddling
* filesystem
* flag
* flagged
* for
* fragments
* guarantee
* guaranteed
* happen
* happening
* hemisphere
* identifier
* identifies
* identify
* implementation
* implemented
* implementing
* including
* inconsistency
* indeterminate
* indices
* individual
* information
* initial
* initialization
* initialize
* initialized
* initializes
* instantiate
* instantiated
* instantiates
* interface
* internal
* interpreted
* interpreter
* into
* it
* iterators
* length
* likely
* log
* longer
* mainly
* mark
* maximum
* message
* minimum
* module
* must
* name
* namespace
* necessary
* nonexistent
* not
* notifications
* notifier
* number
* objects
* occurred
* operations
* original
* otherwise
* output
* overridden
* override
* overriding
* overwriting
* ownership
* parameters
* particular
* payload
* persistent
* potential
* precision
* preexisting
* preservation
* preserved
* primarily
* probably
* procedure
* proceed
* process
* processed
* processes
* processing
* propagate
* propagated
* prototype
* provides
* publishing
* purposes
* queue
* reached
* reason
* reassem
* reassemble
* reassembler
* recommend
* record
* reduction
* reference
* regularly
* representation
* request
* reserved
* retrieve
* returning
* separate
* should
* shouldn't
* significant
* signing
* simplified
* simultaneously
* single
* somebody
* sources
* specific
* specification
* specified
* specifies
* specify
* statement
* subdirectories
* succeeded
* successful
* successfully
* supplied
* synchronization
* tag
* temporarily
* terminating
* that
* the
* transmitted
* true
* truncated
* try
* understand
* unescaped
* unforwarding
* unknown
* unknowndata
* unspecified
* update
* usually
* which
* wildcard

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-11-09 12:08:15 -05:00
Vern Paxson
ee0a6f6835 Script optimization maintenance and updates:
maintenance fixes for variadic run-time checks, '_' placeholder identifier
  "-O allow-cond" permits compiling scripts to C++ when influenced by @if conditionals
  more robust standalone compile-to-C++ properties
  fix for nested "when" statements
  test suite updates
2022-11-08 11:56:32 -08:00
Tim Wojtulewicz
e8dbfc1cb0 Fix a bunch of variable shadowing issues from LGTM 2022-11-02 15:54:51 -07:00
Vern Paxson
02cd773c51 make it non-fatal for optimized scripts to encounter an empty "for" body 2022-09-16 09:38:31 -07:00
Tim Wojtulewicz
2abc82722f Fix a swath of AUTO_CAUSES_COPY issues reported by Coverity 2022-08-15 09:45:46 -07:00
Vern Paxson
18cfee51c2 updates for script optimization 2022-03-23 15:36:35 -07:00
Tim Wojtulewicz
a117c81d85 Fixing a big pile of Coverity issues
1469562/1469558: Uninitialized fields in Func constructor
1469571/1469566: Null pointer dereference in Trigger::Init()
1469568: Uninitialized fields in CounterVector constructor
1469570: Uncaught exception in plugin manager
1469569: Resource leak in script_opt::Stmt
1469561/1469561: Uninitialized fields in ZBody constructor
1469559: Uninitialized fields in logging::Manager
1469563: Resource leak in ZAMCompiler::CompileDel
1469549/1469553/1469556: Context not fully initialized in HashVals
1469548: Remove dead code from IPAddr
1469551/1469554: Handle iosource_mgr registration failure in broker::Manager
1469552/1469572: Resource leaks in input::Manager
2022-02-09 14:07:11 -07:00
Vern Paxson
f895008c34 captures for "when" statements
update Triggers to IntrusivePtr's and simpler AST traversal
introduce IDSet type, migrate associated "ID*" types to "const ID*"
2022-01-07 14:50:35 -08:00
Tim Wojtulewicz
b2f171ec69 Reformat the world 2021-09-16 15:35:39 -07:00
Vern Paxson
da6ac0b521 switch to ID definition regions; reworked driver functions; more info for reporting uncompilable functions 2021-09-08 10:23:38 -07:00
Vern Paxson
d4eb0224a1 addressed a number of code review comments 2021-06-07 10:52:19 -07:00
Vern Paxson
86aafb7c84 fix for inlining type-based switch statements 2021-05-30 17:36:07 -07:00
Vern Paxson
01bf4b8484 making Exec methods non-const, so execution can manage side-information 2021-03-18 08:22:55 -07:00
Vern Paxson
2114c4a26b enhancements/changes to the Reduce class in preparation for use-defs 2021-02-06 09:52:35 -08:00
Jon Siwek
b4cf393475 Adjust some Reducer ref-counting and IntrusivePtr usage 2021-01-14 00:24:12 -08:00
Jon Siwek
177b723a60 Switch some Stmt transform/reduce logic to use IntrusivePtr 2021-01-13 22:57:48 -08:00
Jon Siwek
48da8b7d66 Fix a signed/unsigned comparison warning 2021-01-13 12:31:19 -08:00
Vern Paxson
7a9694a2a4 reduction of Stmt subclasses - compiles but does not yet link 2021-01-10 14:13:16 -08:00
Jon Siwek
481d989495 Superficial changes to script-opt related code
* Rename overly generic ACCESSORS macro with ZEEK_ prefix
* A few places where whitespace was noticeably wrong/distracting
* Minor/obvious reference/move semantics improvements suggested by linter
* Remove unused detail::Scope::Remove(), no need for deprecation
2020-12-13 10:33:28 -08:00