From fa338b70a602d9f5657528d0322535959a92d4b0 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Thu, 12 May 2016 11:54:34 -0700 Subject: Added UPB_ASSERT() that helps avoid unused var warnings. * Added UPB_ASSERT() that helps avoid unused var warnings. * Addressed PR comments. * Fixed assert in the JIT. --- upb/pb/compile_decoder_x64.dasc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'upb/pb/compile_decoder_x64.dasc') diff --git a/upb/pb/compile_decoder_x64.dasc b/upb/pb/compile_decoder_x64.dasc index edda7dd..512c174 100644 --- a/upb/pb/compile_decoder_x64.dasc +++ b/upb/pb/compile_decoder_x64.dasc @@ -153,7 +153,7 @@ static upb_func *gethandler(const upb_handlers *h, upb_selector_t sel) { static void asmlabel(jitcompiler *jc, const char *fmt, ...) { #ifndef NDEBUG int ofs = jc->dynasm->section->ofs; - assert(ofs != jc->lastlabelofs); + UPB_ASSERT(ofs != jc->lastlabelofs); jc->lastlabelofs = ofs; #endif @@ -183,7 +183,7 @@ static bool alwaysok(const upb_handlers *h, upb_selector_t sel) { bool ok = upb_handlers_getattr(h, sel, &attr); bool ret; - UPB_ASSERT_VAR(ok, ok); + UPB_ASSERT(ok); ret = upb_handlerattr_alwaysok(&attr); upb_handlerattr_uninit(&attr); return ret; @@ -641,7 +641,7 @@ static void jitprimitive(jitcompiler *jc, opcode op, case UPB_TYPE_STRING: case UPB_TYPE_BYTES: case UPB_TYPE_MESSAGE: - assert(false); break; + UPB_ASSERT(false); break; } | sethas CLOSURE, data->hasbit } else if (handler) { @@ -790,7 +790,7 @@ static void jitdispatch(jitcompiler *jc, | // Secondary wire type is a match, look up fn + UPB_MAX_FIELDNUMBER. | add rdx, UPB_MAX_FIELDNUMBER | // This key will never be in the array part, so do a hash lookup. - assert(has_hash_entries); + UPB_ASSERT(has_hash_entries); | ld64 dispatch | jmp ->hashlookup // Tail call. } @@ -815,7 +815,7 @@ static void jittag(jitcompiler *jc, uint64_t tag, int n, int ofs, uint32_t *delimend = (jc->pc - 1) + last_arg; const size_t ptr_words = sizeof(void*) / sizeof(uint32_t); - assert((last_instruction & 0xff) == OP_CHECKDELIM); + UPB_ASSERT((last_instruction & 0xff) == OP_CHECKDELIM); if (getop(*(jc->pc - 1)) == OP_TAGN) { jc->pc += ptr_words; @@ -1131,7 +1131,7 @@ static void jitbytecode(jitcompiler *jc) { | call =>jmptarget(jc, &method->dispatch) break; case OP_HALT: - assert(false); + UPB_ASSERT(false); } } -- cgit v1.2.3