Skip to content

Commit

Permalink
Fixed storing lambdas
Browse files Browse the repository at this point in the history
  • Loading branch information
mauro-balades committed Dec 12, 2023
1 parent 2793ebe commit dcd9ee3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/builder/llvm/buildFunc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ void LLVMBuilder::visit(ir::Func* func) {
}

auto bodyGep = builder->CreateStructGEP(getLambdaContextType(), alloca, 1, ".func.use.gep");
//if (copy)
// builder->CreateMemCpy(bodyGep, llvm::MaybeAlign(), body, llvm::MaybeAlign(), builder->getInt64(layout.getTypeAllocSize(builder->getPtrTy())));
builder->CreateStore(body, bodyGep);
if (copy)
builder->CreateMemCpy(bodyGep, llvm::MaybeAlign(), body, llvm::MaybeAlign(), builder->getInt64(layout.getTypeAllocSize(builder->getPtrTy())));
else builder->CreateStore(body, bodyGep);
this->value = alloca;
}
return;
Expand Down

0 comments on commit dcd9ee3

Please sign in to comment.