bh_assert.c 559 B

12345678910111213141516171819202122232425
  1. /*
  2. * Copyright (C) 2019 Intel Corporation. All rights reserved.
  3. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. */
  5. #include "bh_assert.h"
  6. void bh_assert_internal(int v, const char *file_name, int line_number,
  7. const char *expr_string)
  8. {
  9. if (v)
  10. return;
  11. if (!file_name)
  12. file_name = "NULL FILENAME";
  13. if (!expr_string)
  14. expr_string = "NULL EXPR_STRING";
  15. os_printf("\nASSERTION FAILED: %s, at file %s, line %d\n",
  16. expr_string, file_name, line_number);
  17. abort();
  18. }