• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/corennnnn


Commit MetaInfo

修訂ecd23c09e87d7088285f8b7c2eeb98815c2e69e0 (tree)
時間2009-08-09 05:54:49
作者Joe Onorato <joeo@andr...>
CommiterJoe Onorato

Log Message

Try not to crash with no error message.

Change Summary

差異

--- a/libacc/acc.cpp
+++ b/libacc/acc.cpp
@@ -8,6 +8,9 @@
88 *
99 */
1010
11+#define LOG_TAG "acc"
12+#include <cutils/log.h>
13+
1114 #include <ctype.h>
1215 #include <errno.h>
1316 #include <stdarg.h>
@@ -51,6 +54,8 @@
5154 #define ENABLE_ARM_DISASSEMBLY
5255 // #define PROVIDE_TRACE_CODEGEN
5356
57+#define assert(b) assertImpl(b, __LINE__)
58+
5459 namespace acc {
5560
5661 // Subset of STL vector.
@@ -562,10 +567,11 @@ class Compiler : public ErrorSink {
562567 va_end(ap);
563568 }
564569
565- void assert(bool test) {
570+ void assertImpl(bool test, int line) {
566571 if (!test) {
572+ error("code generator assertion failed at line %s:%d.", __FILE__, line);
573+ LOGD("code generator assertion failed at line %s:%d.", __FILE__, line);
567574 * (char*) 0 = 0;
568- error("code generator assertion failed.");
569575 }
570576 }
571577
@@ -3436,8 +3442,9 @@ class Compiler : public ErrorSink {
34363442 * (char*) 0 = 0;
34373443 }
34383444
3439- void assert(bool isTrue) {
3445+ void assertImpl(bool isTrue, int line) {
34403446 if (!isTrue) {
3447+ LOGD("assertion failed at line %s:%d.", __FILE__, line);
34413448 internalError();
34423449 }
34433450 }