[Sanitizer] fix compilation warning
authorDavid Carlier <devnexen@gmail.com>
Thu, 14 Jun 2018 04:51:26 +0000 (04:51 +0000)
committerDavid Carlier <devnexen@gmail.com>
Thu, 14 Jun 2018 04:51:26 +0000 (04:51 +0000)
In most of systems, this field is a signed type but in some it is an unsigned.

Reviewers: vitalybuka

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D48118

llvm-svn: 334686

compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc

index 20840ce7f89c08dfc723e461d0fe0e89ddae2e88..d309dac8b72ee50231eaacbfe999c2bd9e109397 100644 (file)
@@ -522,7 +522,7 @@ static int dl_iterate_phdr_cb(dl_phdr_info *info, size_t size, void *arg) {
     return 0;
   LoadedModule cur_module;
   cur_module.set(module_name.data(), info->dlpi_addr);
-  for (int i = 0; i < info->dlpi_phnum; i++) {
+  for (int i = 0; i < (int)info->dlpi_phnum; i++) {
     const Elf_Phdr *phdr = &info->dlpi_phdr[i];
     if (phdr->p_type == PT_LOAD) {
       uptr cur_beg = info->dlpi_addr + phdr->p_vaddr;