Преглед на файлове

adding asserts to help clang static analyzer
disallow clang analyzis build to fail

Stasik0 преди 9 години
родител
ревизия
0f7b52fc99
променени са 2 файла, в които са добавени 3 реда и са изтрити 0 реда
  1. 1 0
      .travis.yml
  2. 2 0
      src/ua_types_encoding_binary.c

+ 1 - 0
.travis.yml

@@ -29,6 +29,7 @@ matrix:
       env: ANALYZE=true
   allow_failures:
     - env: ANALYZE=true
+      compiler: gcc
 
 addons:
   apt:

+ 2 - 0
src/ua_types_encoding_binary.c

@@ -684,6 +684,8 @@ ExtensionObject_decodeBinary(bufpos pos, bufend end, UA_ExtensionObject *dst) {
     } else {
         /* try to decode the content */
         type = NULL;
+        UA_assert(typeId.identifier.byteString.data == NULL); //helping clang analyzer, typeId is numeric
+        UA_assert(typeId.identifier.string.data == NULL); //helping clang analyzer, typeId is numeric
         typeId.identifier.numeric -= UA_ENCODINGOFFSET_BINARY;
         findDataType(&typeId, &type);
         if(type) {