[PATCH] D19085: [clang-analyzer] fix warnings emitted on compiler-rt code base

George Burgess IV via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 14 15:45:55 PDT 2016


george.burgess.iv accepted this revision.
george.burgess.iv added a reviewer: george.burgess.iv.
george.burgess.iv added a comment.
This revision is now accepted and ready to land.

> I forgot 'void *' can indeed hold any data pointer. Generated code should indeed be identical, thanks for your patience :-).


Not a problem!

> It works, the static analyzer goes silent with this change.


Yay :)

Looks good to me after a few tiny changes. After it's updated, will you need me to check this in for you?


================
Comment at: lib/builtins/emutls.c:167
@@ -166,2 +166,3 @@
         uintptr_t new_size = emutls_new_data_array_size(index);
-        array = calloc(new_size + 1, sizeof(void*));
+        array = malloc(new_size * sizeof(void *) + sizeof(emutls_address_array *));
+        if (array)
----------------
Change `sizeof(emutls_address_array *)` to `sizeof(emutls_address_array)`, please.

================
Comment at: lib/builtins/emutls.c:174
@@ -171,3 +173,3 @@
         uintptr_t new_size = emutls_new_data_array_size(index);
-        array = realloc(array, (new_size + 1) * sizeof(void*));
+        array = realloc(array, new_size * sizeof(void *) + sizeof(emutls_address_array *));
         if (array)
----------------
Same as above.


http://reviews.llvm.org/D19085





More information about the llvm-commits mailing list