Commit graph

476 commits

Author SHA1 Message Date
Tim Wojtulewicz
edf90a51e4 GH-1624: Migrate check_and_promote and a few Expr methods to IntrusivePtr 2022-01-07 12:33:54 -07:00
Vern Paxson
4f566f35ee bug fix for reporting poorly formed record constructors 2021-12-22 14:26:03 -08:00
Tim Wojtulewicz
c15a9eab7f GH-1740: Report a better error message if table key is not a list 2021-12-09 14:35:21 -07:00
Vern Paxson
06bbd167cd fixes for constructing and assigning records with fields that are empty vectors 2021-11-24 11:16:33 -08:00
Tim Wojtulewicz
e63ea95664 Apply some missing clang-format changes 2021-10-21 16:38:57 -07:00
Christian Kreibich
175d9297e3 Expression tweaks to get complex types to work as container indices 2021-10-01 14:03:08 -07:00
Tim Wojtulewicz
9af6b2f48d clang-format: Set penalty for breaking after assignment operator 2021-09-27 10:49:48 -07:00
Tim Wojtulewicz
4423574d26 clang-format: Set IndentCaseBlocks to false 2021-09-27 10:49:48 -07:00
Tim Wojtulewicz
9cb54f5d44 clang-format: Force zeek-config.h to be earlier in the config ordering 2021-09-25 11:52:55 -07:00
Tim Wojtulewicz
b2f171ec69 Reformat the world 2021-09-16 15:35:39 -07:00
Vern Paxson
074b18f3e8 tracking of optimization information associated with expressions 2021-09-08 10:23:38 -07:00
Vern Paxson
b4a44ed663 low-level tidying/nits - no semantic changes 2021-09-08 10:23:38 -07:00
Tim Wojtulewicz
9b15db25f6 Reorder fields in some classes for more compact memory layout 2021-07-14 14:59:49 -07:00
Vern Paxson
d4eb0224a1 addressed a number of code review comments 2021-06-07 10:52:19 -07:00
Vern Paxson
7a96d2fa61 better descriptions for named record constructors 2021-06-02 15:57:25 -07:00
Vern Paxson
c662f8fbe8 factor out "cast" functionality to make available to lower-level ZAM access 2021-05-30 18:11:08 -07:00
Vern Paxson
1cbec158f3 tidying for check_and_promote_expr 2021-05-30 18:09:53 -07:00
Vern Paxson
8044926e00 employ explicit conversions to/from "any" and "vector of any" types 2021-05-30 18:05:11 -07:00
Vern Paxson
292bd1b671 more robust treatment of arithmetic coercions 2021-05-30 18:02:30 -07:00
Vern Paxson
65be1b5d76 factoring out of low-level vector indexing to make available to ZAM 2021-05-30 17:51:54 -07:00
Vern Paxson
0742d2da29 minor changes for more robust behavior in the face of errors 2021-05-30 17:49:08 -07:00
Vern Paxson
9a429808ab directly construct records of known types, rather than requiring coercion 2021-05-30 17:47:28 -07:00
Vern Paxson
0de51b31b1 fix for computing |size| of files and subnets 2021-05-30 17:33:49 -07:00
Vern Paxson
4ee8bd0082 Expr method to invert the sense of a relational 2021-05-30 17:31:22 -07:00
Vern Paxson
a16a25efbd fixed / removed out-of-date comments, tidied check_and_promote_args() interface 2021-05-30 17:25:40 -07:00
Vern Paxson
efd03d41f8 convert scopes to be managed using IntrusivePtr's 2021-05-30 17:20:29 -07:00
Jon Siwek
486f187b15 GH-1483: Improve error for mismatched container initialization types
For example, trying to assign a vector, table, set, or record
constructor expression to a global variable of a different type now
provides a more explanatory error message than the previous
"Val::CONVERTER" fatal-error and coredump.
2021-04-20 19:14:13 -07:00
Vern Paxson
ff393dbd8a fix using ++/-- to vectors that contain holes 2021-04-14 18:16:19 -07:00
Vern Paxson
4aa73f6f7d micro whitespace nit 2021-04-01 17:33:03 -07:00
Jon Siwek
43d9bda007 Fix sign-compare compiler warning in coerce_to_record() 2021-03-26 21:59:30 -07:00
Vern Paxson
a7fcc7a5d8 Use STL functionality to initialize coercion map 2021-03-24 15:03:03 -07:00
Vern Paxson
91c2e05099 factor out record coercion; modernize management of coercion "map" 2021-03-24 15:03:00 -07:00
Vern Paxson
b792feccab functions for indexing slices and strings 2021-03-24 15:01:19 -07:00
Tim Wojtulewicz
f45df63cd0 Merge remote-tracking branch 'origin/topic/vern/zval'
* origin/topic/vern/zval: (42 commits)
  whitespace tweaks
  resolved some TODO comments
  remove unnecessary casts, and change necessary ones to use static_cast<>
  explain cmp_func default
  change functions for ZVal type management to static members
  fix some unsigned/signed integer warnings
  address lint concern about uninitialized variable
  Remove use of obsolete forward-declaration macros
  fix #include's that lack zeek/ prefixes
  explicitly populate holes created in vectors
  fixes for now-incorrect assumption that GetField always returns an existing ValPtr
  memory management for assignment to vector elements
  memory management for assignment to record fields
  destructor cleanup from ZAM_vector/ZAM_record
  fix #include's that lack zeek/ prefixes
  overlooked another way in which vector holes can be created
  initialize vector holes to the correct corresponding type
  explicitly populate holes created in vectors
  fix other instances of GetField().get() assuming long-lived ValPtr's
  fix for now-incorrect assumption that GetField always returns an existing ValPtr
  ...
2021-03-23 20:44:19 -07:00
Vern Paxson
d5b523cd2c whitespace tweaks 2021-03-22 21:23:15 -07:00
Vern Paxson
e21c0f1115 correcting some simple typos 2021-03-18 08:19:46 -07:00
Vern Paxson
45b9371e38 remove unneeded virtual method (same as inherited method) 2021-02-27 10:49:57 -08:00
Vern Paxson
a912f6dd9a tidying some interfaces 2021-02-27 08:32:04 -08:00
Vern Paxson
b6f4f897c6 migrate to using RecordVal's new Remove() method 2021-02-25 15:28:37 -08:00
Vern Paxson
0118b6ee38 migrate to differentiated vector "At" accessors to support future efficiency 2021-02-25 13:28:23 -08:00
Vern Paxson
3f6f8e0709 use HasField() rather than GetField() where appropriate 2021-02-25 12:38:46 -08:00
Jon Siwek
cfe29c2488 Merge branch 'master' into topic/vern/reaching-defs 2021-02-01 17:27:37 -08:00
Jon Siwek
8a8a983c49 Add missing zeek/ to header includes
Related to https://github.com/zeek/zeek/pull/1377
2021-01-29 19:16:29 -08:00
Vern Paxson
9b549e4034 additional converters and accessors for Expr subclasses 2021-01-23 10:48:14 -08:00
Jon Siwek
7f3f5a868f Merge remote-tracking branch 'origin/topic/jsiwek/gh-1296-fix-list-type-checks'
* origin/topic/jsiwek/gh-1296-fix-list-type-checks:
  GH-1296: fix type-checks related to list-type equality
2021-01-21 14:00:07 -08:00
Jon Siwek
16942f3859 Merge remote-tracking branch 'origin/topic/vern/script-xform'
* origin/topic/vern/script-xform: (30 commits)
  Adjust some Reducer ref-counting and IntrusivePtr usage
  Fix reference counting in ListExpr inline/reduce methods
  Simplify WhileStmt::CondPredStmt()
  Use std::move() in Case::UpdateBody()
  Switch some Stmt transform/reduce logic to use IntrusivePtr
  Switch some Expr transform/reduce logic to use IntrusivePtr
  Adjust how some Expr::SetOpX() calls use std::move()
  Add missing header-includes to Reduce.h
  Add std::move() for args to an assign_to_index call
  Adjust memory management for &default argument expression type-check
  Use string for TempVar::name
  Switch AnalyOpt::only_func to optional<string>
  Fix a signed/unsigned comparison warning
  simplified some vestigial complexity I noticed when flipping through diffs
  canonicalization for an error message in one of the alternative test baselines
  baseline differences for "xform" alternative: changes generally reflect exposure of transformed code, or error propagation stopping earlier due to error now occurring in an assignment (to a temporary)
  new testing alternative for script transformation (= xform)
  bug in correctly inspecting test output file
  split bifs.string_utils into a non-error test and an only-errors test, to help control for differing error propagation
  logic for driving the script optimization process
  ...
2021-01-14 15:15:22 -08:00
Tim Wojtulewicz
a94fcad957 Add templated As() method to Val, use in various places we were using dynamic_cast 2021-01-14 11:58:59 -07:00
Vern Paxson
e652aff277 Changes addressing pending issues per PR discussion 2021-01-14 11:58:59 -07:00
Vern Paxson
7f92a573d2 Remove BroValUnion by hoisting underlying Val subclass values into subclasses 2021-01-14 11:58:59 -07:00
Jon Siwek
2c8106295d Add std::move() for args to an assign_to_index call 2021-01-13 15:25:25 -08:00