Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Builder::create<OpBranchConditional>: Fix access to destroyed array.
Previously, md_arr was a named ArrayRef variable constructed from an initializer list. This initializer list causes a temporary array to be created, the ArrayRef is then bound to that temporary array, and then the temporary array gets destroyed. In the subsequent call to llvm::MDTuple::get(*context.llvmContext, md_arr) then, md_arr no longer referenced any array still in existence. Make md_arr an array instead, like its name implies, to ensure it lives long enough to still be valid during MDTuple::get.
- Loading branch information