mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 15:48:19 +00:00
safety checking for initializing scripts compiled to C++
This commit is contained in:
parent
5c21240daf
commit
6ad28b37e6
1 changed files with 35 additions and 6 deletions
|
@ -66,12 +66,41 @@ public:
|
||||||
// Accessors for the sundry initialization vectors, each retrieving
|
// Accessors for the sundry initialization vectors, each retrieving
|
||||||
// a specific element identified by an index/offset.
|
// a specific element identified by an index/offset.
|
||||||
const std::vector<int>& Indices(int offset) const { return indices[offset]; }
|
const std::vector<int>& Indices(int offset) const { return indices[offset]; }
|
||||||
const char* Strings(int offset) const { return strings[offset]; }
|
const char* Strings(int offset) const
|
||||||
const p_hash_type Hashes(int offset) const { return hashes[offset]; }
|
{
|
||||||
const TypePtr& Types(int offset) const { return types[offset]; }
|
ASSERT(offset >= 0 && offset < strings.size());
|
||||||
const AttributesPtr& Attributes(int offset) const { return attributes[offset]; }
|
ASSERT(strings[offset]);
|
||||||
const AttrPtr& Attrs(int offset) const { return attrs[offset]; }
|
return strings[offset];
|
||||||
const CallExprPtr& CallExprs(int offset) const { return call_exprs[offset]; }
|
}
|
||||||
|
const p_hash_type Hashes(int offset) const
|
||||||
|
{
|
||||||
|
ASSERT(offset >= 0 && offset < hashes.size());
|
||||||
|
return hashes[offset];
|
||||||
|
}
|
||||||
|
const TypePtr& Types(int offset) const
|
||||||
|
{
|
||||||
|
ASSERT(offset >= 0 && offset < types.size());
|
||||||
|
ASSERT(types[offset]);
|
||||||
|
return types[offset];
|
||||||
|
}
|
||||||
|
const AttributesPtr& Attributes(int offset) const
|
||||||
|
{
|
||||||
|
ASSERT(offset >= 0 && offset < attributes.size());
|
||||||
|
ASSERT(attributes[offset]);
|
||||||
|
return attributes[offset];
|
||||||
|
}
|
||||||
|
const AttrPtr& Attrs(int offset) const
|
||||||
|
{
|
||||||
|
ASSERT(offset >= 0 && offset < attrs.size());
|
||||||
|
ASSERT(attrs[offset]);
|
||||||
|
return attrs[offset];
|
||||||
|
}
|
||||||
|
const CallExprPtr& CallExprs(int offset) const
|
||||||
|
{
|
||||||
|
ASSERT(offset >= 0 && offset < call_exprs.size());
|
||||||
|
ASSERT(call_exprs[offset]);
|
||||||
|
return call_exprs[offset];
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<CPP_ValElem>& const_vals;
|
std::vector<CPP_ValElem>& const_vals;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue