mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Fixed zeroing of paramdecl in lambdas
This commit is contained in:
parent
6976de31af
commit
3d3cde906b
2 changed files with 12 additions and 0 deletions
|
@ -1399,6 +1399,17 @@ public:
|
|||
val->InitWithTypeId(T::sTypeInfo.mTypeId);
|
||||
return val;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
static void Zero(T* val)
|
||||
{
|
||||
#ifdef BF_AST_COMPACT
|
||||
memset((uint8*)val + offsetof(T, mAstInfo), 0, sizeof(T) - offsetof(T, mAstInfo));
|
||||
#else
|
||||
memset((uint8*)val + offsetof(T, mTriviaStart), 0, sizeof(T) - offsetof(T, mTriviaStart));
|
||||
#endif
|
||||
val->InitWithTypeId(T::sTypeInfo.mTypeId);
|
||||
}
|
||||
#endif
|
||||
};
|
||||
#ifdef BF_AST_DO_IMPL
|
||||
|
|
|
@ -10058,6 +10058,7 @@ BfLambdaInstance* BfExprEvaluator::GetLambdaInstance(BfLambdaBindExpression* lam
|
|||
|
||||
BfParameterDef* paramDef = new BfParameterDef();
|
||||
paramDef->mParamDeclaration = tempParamDecls.Alloc();
|
||||
BfAstNode::Zero(paramDef->mParamDeclaration);
|
||||
|
||||
BfLocalVariable* localVar = new BfLocalVariable();
|
||||
if (paramIdx < (int)lambdaBindExpr->mParams.size())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue