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/bindings/googlepb/bridge.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'upb/bindings/googlepb/bridge.h') diff --git a/upb/bindings/googlepb/bridge.h b/upb/bindings/googlepb/bridge.h index ec8ac41..ce55dc6 100644 --- a/upb/bindings/googlepb/bridge.h +++ b/upb/bindings/googlepb/bridge.h @@ -128,7 +128,7 @@ class DefBuilder { template T* AddToCache(const void *proto2_descriptor, reffed_ptr def) { - assert(def_cache_.find(proto2_descriptor) == def_cache_.end()); + UPB_ASSERT(def_cache_.find(proto2_descriptor) == def_cache_.end()); def_cache_[proto2_descriptor] = def; return def.get(); // Continued lifetime is guaranteed by cache. } @@ -207,7 +207,7 @@ class CodeCache { const MessageDef* md, const ::google::protobuf::Message& m); Handlers* AddToCache(const MessageDef* md, reffed_ptr handlers) { - assert(handlers_cache_.find(md) == handlers_cache_.end()); + UPB_ASSERT(handlers_cache_.find(md) == handlers_cache_.end()); handlers_cache_[md] = handlers; return handlers.get(); // Continue lifetime is guaranteed by the cache. } -- cgit v1.2.3