mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 22:58:20 +00:00
Merge branch 'master' into topic/vern/lambda-copy-semantics
This commit is contained in:
commit
614fade0a4
68 changed files with 21745 additions and 252 deletions
23
src/Frame.h
23
src/Frame.h
|
@ -59,7 +59,12 @@ public:
|
|||
* @return the value at index *n* of the underlying array.
|
||||
*/
|
||||
const ValPtr& GetElement(int n) const
|
||||
{ return frame[n].val; }
|
||||
{
|
||||
// Note: technically this may want to adjust by current_offset, but
|
||||
// in practice, this method is never called from anywhere other than
|
||||
// function call invocation, where current_offset should be zero.
|
||||
return frame[n].val;
|
||||
}
|
||||
|
||||
[[deprecated("Remove in v4.1. Use GetElement(int).")]]
|
||||
Val* NthElement(int n) const { return frame[n].val.get(); }
|
||||
|
@ -99,6 +104,15 @@ public:
|
|||
Val* GetElement(const ID* id) const
|
||||
{ return GetElementByID(id).get(); }
|
||||
|
||||
/**
|
||||
* Adjusts the current offset being used for frame accesses.
|
||||
* This is in support of inlined functions.
|
||||
*
|
||||
* @param incr Amount by which to increase the frame offset.
|
||||
* Use a negative value to shrink the offset.
|
||||
*/
|
||||
void AdjustOffset(int incr) { current_offset += incr; }
|
||||
|
||||
/**
|
||||
* Resets all of the indexes from [*startIdx, frame_size) in
|
||||
* the Frame.
|
||||
|
@ -338,6 +352,13 @@ private:
|
|||
/** Associates ID's offsets with values. */
|
||||
std::unique_ptr<Element[]> frame;
|
||||
|
||||
/**
|
||||
* The offset we're currently using for references into the frame.
|
||||
* This is how we support inlined functions without having to
|
||||
* alter the offsets associated with their local variables.
|
||||
*/
|
||||
int current_offset;
|
||||
|
||||
/** The enclosing frame of this frame. Used for reference semantics. */
|
||||
Frame* closure;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue