Properly handle asserts for libbcc.
BUG=3430681
Change-Id: I906bbdefa6724cefa0e11f04ff1c5a9bc85ab88b
diff --git a/lib/ExecutionEngine/Compiler.cpp b/lib/ExecutionEngine/Compiler.cpp
index b1bd093..4eaf87d 100644
--- a/lib/ExecutionEngine/Compiler.cpp
+++ b/lib/ExecutionEngine/Compiler.cpp
@@ -521,8 +521,8 @@
varList.push_back(NULL);
}
- assert((varList.size() == ExportVarMetadata->getNumOperands()) &&
- "Number of slots doesn't match the number of export variables!");
+ bccAssert((varList.size() == ExportVarMetadata->getNumOperands()) &&
+ "Number of slots doesn't match the number of export variables!");
}
if (ExportFuncMetadata) {
diff --git a/lib/ExecutionEngine/Runtime.c b/lib/ExecutionEngine/Runtime.c
index e814361..f940c35 100644
--- a/lib/ExecutionEngine/Runtime.c
+++ b/lib/ExecutionEngine/Runtime.c
@@ -16,9 +16,11 @@
#include "RuntimeStub.h"
+#include <bcc/bcc_assert.h>
+
+#include <stdbool.h>
#include <string.h>
#include <stdlib.h>
-#include <assert.h>
typedef struct {
const char *mName;
@@ -79,7 +81,7 @@
int *Ptr = FindRuntimeFunction(Name);
if (Ptr != (int*) gRuntimes[i].mPtr)
- assert(false && "Table is corrupted (runtime name should be sorted in "
- "Runtime.def).");
+ bccAssert(false && "Table is corrupted (runtime name should be sorted "
+ "in Runtime.def).");
}
}