瀏覽代碼

cache sync: move assert() behind declarations

Marian Beermann 8 年之前
父節點
當前提交
49ca3dca33
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/borg/cache_sync/unpack_template.h

+ 2 - 2
src/borg/cache_sync/unpack_template.h

@@ -54,8 +54,6 @@ static inline void unpack_init(unpack_context* ctx)
 
 
 static inline int unpack_execute(unpack_context* ctx, const char* data, size_t len, size_t* off)
 static inline int unpack_execute(unpack_context* ctx, const char* data, size_t len, size_t* off)
 {
 {
-    assert(len >= *off);
-
     const unsigned char* p = (unsigned char*)data + *off;
     const unsigned char* p = (unsigned char*)data + *off;
     const unsigned char* const pe = (unsigned char*)data + len;
     const unsigned char* const pe = (unsigned char*)data + len;
     const void* n = NULL;
     const void* n = NULL;
@@ -70,6 +68,8 @@ static inline int unpack_execute(unpack_context* ctx, const char* data, size_t l
 
 
     int ret;
     int ret;
 
 
+    assert(len >= *off);
+
 #define construct_cb(name) \
 #define construct_cb(name) \
     construct && unpack_callback ## name
     construct && unpack_callback ## name