[llvm] r325712 - Fix a memory leak and a cross module reference.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 21 11:55:11 PST 2018
Author: rafael
Date: Wed Feb 21 11:55:11 2018
New Revision: 325712
URL: http://llvm.org/viewvc/llvm-project?rev=325712&view=rev
Log:
Fix a memory leak and a cross module reference.
Modified:
llvm/trunk/tools/llvm-c-test/echo.cpp
Modified: llvm/trunk/tools/llvm-c-test/echo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-c-test/echo.cpp?rev=325712&r1=325711&r2=325712&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-c-test/echo.cpp (original)
+++ llvm/trunk/tools/llvm-c-test/echo.cpp Wed Feb 21 11:55:11 2018
@@ -438,7 +438,7 @@ struct FunCloner {
LLVMBasicBlockRef ElseBB = DeclareBB(LLVMValueAsBasicBlock(Else));
LLVMValueRef Then = LLVMGetOperand(Src, 2);
LLVMBasicBlockRef ThenBB = DeclareBB(LLVMValueAsBasicBlock(Then));
- Dst = LLVMBuildCondBr(Builder, Cond, ThenBB, ElseBB);
+ Dst = LLVMBuildCondBr(Builder, CloneValue(Cond), ThenBB, ElseBB);
break;
}
case LLVMSwitch:
@@ -949,6 +949,7 @@ int llvm_echo(void) {
fputs(Str, stdout);
LLVMDisposeMessage(Str);
+ LLVMDisposeModule(Src);
LLVMDisposeModule(M);
LLVMContextDispose(Ctx);
More information about the llvm-commits
mailing list