mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
fixes for -O gen-standalone-C++ generation of lambdas
This commit is contained in:
parent
b2222e97a1
commit
a3b54b69a1
4 changed files with 23 additions and 11 deletions
|
@ -30,8 +30,13 @@ void CPPCompile::DeclareLambda(const LambdaExpr* l, const ProfileFunc* pf) {
|
|||
auto l_id = l->Ingredients()->GetID();
|
||||
auto& ids = l->OuterIDs();
|
||||
|
||||
for ( auto id : ids )
|
||||
lambda_names[id] = CaptureName(id);
|
||||
for ( auto lid : ids ) {
|
||||
if ( lambda_names.count(lid) > 0 ) {
|
||||
ASSERT(lambda_names[lid] == CaptureName(lid));
|
||||
}
|
||||
else
|
||||
lambda_names[lid] = CaptureName(lid);
|
||||
}
|
||||
|
||||
CreateFunction(l_id->GetType<FuncType>(), pf, lname, body, 0, l, FUNC_FLAVOR_FUNCTION);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue