some final fixups

This commit is contained in:
Vern Paxson 2024-08-03 13:26:11 +01:00
parent d7df53d5c3
commit ffb8f27d6b
4 changed files with 6 additions and 2 deletions

View file

@ -614,6 +614,9 @@ SetType::~SetType() = default;
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
FuncType::Capture::Capture(detail::IDPtr _id, bool _deep_copy) : id(std::move(_id)), deep_copy(_deep_copy) {
is_managed = id ? ZVal::IsManagedType(id->GetType()) : false;
if ( ! is_managed )
// For non-managed types, deep copying isn't applicable.
deep_copy = false;
}
#pragma GCC diagnostic pop

View file

@ -62,6 +62,7 @@ union ZVal {
ZVal(const TypePtr& t);
// Construct directly.
ZVal(bool v) { int_val = v; }
ZVal(zeek_int_t v) { int_val = v; }
ZVal(zeek_uint_t v) { uint_val = v; }
ZVal(double v) { double_val = v; }

View file

@ -219,8 +219,6 @@ void ZAMCompiler::ResolveHookBreaks() {
// Rewrite the breaks.
for ( auto& b : breaks[0] ) {
auto& i = insts1[b.stmt_num];
// Preserve the auxiliary information (control-flow types
// in particular).
auto aux = i->aux;
*i = ZInstI(OP_HOOK_BREAK_X);
i->aux = aux;

View file

@ -21,6 +21,8 @@ assign-val v
eval auto& v = Z_FRAME->GetElement($1);
internal-assignment-op Load-Global
# We don't use GlobalVal() for the assignment because we want to leverage
# the bookkeeping that assign-val gives us in terms of memory management.
class Vg
assign-val v
eval auto& v = GlobalID($1)->GetVal();