diff --git a/CHANGES b/CHANGES index c23ec591e3..4184d7015d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,10 @@ +7.0.0-dev.114 | 2024-04-10 11:02:32 +0200 + + * Bump Spicy, including necessary changes to work with the current + Spicy version. (Robin Sommer, Corelight) + + * Remove some unused Spicy state. (Robin Sommer, Corelight) + 7.0.0-dev.111 | 2024-04-09 15:12:13 -0700 * ZAM fix for concretizing vectors in record constructors (Vern Paxson, Corelight) diff --git a/VERSION b/VERSION index c072551ec3..9cf112d2ca 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -7.0.0-dev.111 +7.0.0-dev.114 diff --git a/auxil/spicy b/auxil/spicy index 18a7377024..d38f31a95f 160000 --- a/auxil/spicy +++ b/auxil/spicy @@ -1 +1 @@ -Subproject commit 18a7377024003040db19c060f67484ec90ba0753 +Subproject commit d38f31a95f93b1d9ea81fa01f0c92a72cf40f38c diff --git a/src/spicy/spicyz/glue-compiler.cc b/src/spicy/spicyz/glue-compiler.cc index c29bc7a10c..cc17312343 100644 --- a/src/spicy/spicyz/glue-compiler.cc +++ b/src/spicy/spicyz/glue-compiler.cc @@ -1374,7 +1374,8 @@ bool GlueCompiler::CreateSpicyHook(glue::Event* ev) { body.addCall("zeek_rt::raise_event", {handler_expr, builder()->move(builder()->id("args"))}, meta); auto attrs = builder()->attributeSet({builder()->attribute("&priority", builder()->integer(ev->priority))}); - auto unit_hook = builder()->declarationHook(ev->parameters, body.block(), ::spicy::Engine::All, attrs, meta); + auto parameters = hilti::util::transform(ev->parameters, [](const auto& p) { return p.get(); }); + auto unit_hook = builder()->declarationHook(parameters, body.block(), ::spicy::Engine::All, attrs, meta); auto hook_decl = builder()->declarationUnitHook(ev->hook, unit_hook, meta); ev->spicy_module->spicy_module->add(context(), hook_decl); diff --git a/src/spicy/spicyz/glue-compiler.h b/src/spicy/spicyz/glue-compiler.h index b3b84ffb81..58e42909f3 100644 --- a/src/spicy/spicyz/glue-compiler.h +++ b/src/spicy/spicyz/glue-compiler.h @@ -101,35 +101,33 @@ struct SpicyModule { std::set evts; /**< EVT files that refer to this module. */ // Generated code. - hilti::declaration::Module* spicy_module = nullptr; /**< the ``BroHooks_*.spicy`` module. */ + hilti::node::RetainedPtr spicy_module = + nullptr; /**< the ``BroHooks_*.spicy`` module. */ }; /** Representation of an event parsed from an EVT file. */ struct Event { // Information parsed directly from the *.evt file. - hilti::rt::filesystem::path file; /**< The path of the *.evt file we parsed this from. */ - hilti::ID name; /**< The name of the event. */ - hilti::ID path; /**< The hook path as specified in the evt file. */ - hilti::type::function::Parameters parameters; /**< Event parameters specified in the evt file. */ - std::string condition; /**< Condition that must be true for the event to trigger. */ - std::vector exprs; /**< The argument expressions. */ - int priority; /**< Event/hook priority. */ - hilti::Location location; /**< Location where event is defined. */ + hilti::rt::filesystem::path file; /**< The path of the *.evt file we parsed this from. */ + hilti::ID name; /**< The name of the event. */ + hilti::ID path; /**< The hook path as specified in the evt file. */ + std::vector> + parameters; /**< Event parameters specified in the evt file. */ + std::string condition; /**< Condition that must be true for the event to trigger. */ + std::vector exprs; /**< The argument expressions. */ + int priority; /**< Event/hook priority. */ + hilti::Location location; /**< Location where event is defined. */ // Computed information. - hilti::ID hook; /**< The name of the hook triggering the event. */ - hilti::ID unit; /**< The fully qualified name of the unit type. */ - ::spicy::type::Unit* unit_type = nullptr; /**< The Spicy type of referenced unit. */ + hilti::ID hook; /**< The name of the hook triggering the event. */ + hilti::ID unit; /**< The fully qualified name of the unit type. */ + hilti::node::RetainedPtr<::spicy::type::Unit> unit_type = nullptr; /**< The Spicy type of referenced unit. */ hilti::ID unit_module_id; /**< The name of the module the referenced unit is defined in. */ hilti::rt::filesystem::path unit_module_path; /**< The path of the module that the referenced unit is defined in. */ std::shared_ptr spicy_module; /**< State for the Spichy module the referenced unit is defined in. */ - // TODO: The following aren't set yet. - // Code generation. - ::spicy::type::unit::item::UnitHook* spicy_hook = nullptr; /**< The generated Spicy hook. */ - hilti::declaration::Function* hilti_raise = nullptr; /**< The generated HILTI raise() function. */ std::vector expression_accessors; /**< One HILTI function per expression to access the value. */ }; @@ -167,7 +165,7 @@ public: * Returns the AST context in use. Only available once the driver has * initialized the glue compiler. */ - auto* context() { return _driver->context()->astContext().get(); } + auto* context() { return _driver->context()->astContext(); } /** * Returns the AST builder in use. Only available once the driver has