Fix bccLinkBC.
Change-Id: I67d6f1a0dabfb272416a1f89258252facfbb3c00
diff --git a/lib/bcc/Compiler.cpp b/lib/bcc/Compiler.cpp
index e13d989..c011fd8 100644
--- a/lib/bcc/Compiler.cpp
+++ b/lib/bcc/Compiler.cpp
@@ -263,10 +263,13 @@
}
+// bitcodeSize == 1: Link against file
+// bitcodeSize > 1: Link against buffer
int Compiler::linkBC(const char *bitcode, size_t bitcodeSize) {
llvm::OwningPtr<llvm::MemoryBuffer> MEM;
- if (bitcode == NULL || bitcodeSize <= 0) {
+ if (bitcodeSize = 1) { // link against file
+ } else if (bitcode == NULL || bitcodeSize <= 0) {
LOGE("Invalid bitcode for linkBC\n");
return 1;
}