mirror of
https://github.com/zeek/zeek.git
synced 2025-10-16 05:28:20 +00:00
for cat() replacements, confine frame knowledge to aux
This commit is contained in:
parent
b62b31846e
commit
8088f91145
5 changed files with 104 additions and 90 deletions
|
@ -337,6 +337,21 @@ public:
|
|||
return zv;
|
||||
}
|
||||
|
||||
// The same, but for read-only access for which memory-management is
|
||||
// not required.
|
||||
const ZVal& ToDirectZVal(const ZVal* frame) const {
|
||||
if ( c )
|
||||
return zc;
|
||||
if ( i >= 0 )
|
||||
return frame[i];
|
||||
|
||||
// Currently the way we use AuxElem's we shouldn't get here, but
|
||||
// just in case we do, return something sound rather than mis-indexing
|
||||
// the frame.
|
||||
static ZVal null_zval;
|
||||
return null_zval;
|
||||
}
|
||||
|
||||
int Slot() const { return i; }
|
||||
int IntVal() const { return i; }
|
||||
const ValPtr& Constant() const { return c; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue