mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 23:58:20 +00:00
Bif const: make sure const is indeed a constant.
This commit is contained in:
parent
782f007b5c
commit
f3aa7b2fac
3 changed files with 13 additions and 1 deletions
11
src/Var.cc
11
src/Var.cc
|
@ -343,6 +343,17 @@ Val* internal_val(const char* name)
|
|||
return id->ID_Val();
|
||||
}
|
||||
|
||||
Val* internal_const_val(const char* name)
|
||||
{
|
||||
ID* id = lookup_ID(name, GLOBAL_MODULE_NAME);
|
||||
if ( ! id )
|
||||
internal_error("internal variable %s missing", name);
|
||||
if ( ! id->IsConst())
|
||||
internal_error("internal variable %s is not constant", name);
|
||||
|
||||
return id->ID_Val();
|
||||
}
|
||||
|
||||
Val* opt_internal_val(const char* name)
|
||||
{
|
||||
ID* id = lookup_ID(name, GLOBAL_MODULE_NAME);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue