[compiler-rt] r189814 - [asan] attemping to fix the Windows build

Timur Iskhodzhanov timurrrr at google.com
Tue Sep 3 08:07:47 PDT 2013


One left to go

asan_report.cc(348) : error C2220: warning treated as error - no 'object'
file generated
asan_report.cc(348) : warning C4244: 'argument' : conversion from
'__sanitizer::u64' to '__sanitizer::uptr', possible loss of data



2013/9/3 Kostya Serebryany <kcc at google.com>

> Author: kcc
> Date: Tue Sep  3 09:53:02 2013
> New Revision: 189814
>
> URL: http://llvm.org/viewvc/llvm-project?rev=189814&view=rev
> Log:
> [asan] attemping to fix the Windows build
>
> Modified:
>     compiler-rt/trunk/lib/asan/asan_report.cc
>
> Modified: compiler-rt/trunk/lib/asan/asan_report.cc
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_report.cc?rev=189814&r1=189813&r2=189814&view=diff
>
> ==============================================================================
> --- compiler-rt/trunk/lib/asan/asan_report.cc (original)
> +++ compiler-rt/trunk/lib/asan/asan_report.cc Tue Sep  3 09:53:02 2013
> @@ -295,13 +295,13 @@ struct StackVarDescr {
>    uptr beg;
>    uptr size;
>    const char *name_pos;
> -  s64 name_len;
> +  uptr name_len;
>  };
>
>  bool DescribeAddressIfStack(uptr addr, uptr access_size) {
>    AsanThread *t = FindThreadByStackAddress(addr);
>    if (!t) return false;
> -  const s64 kBufSize = 4095;
> +  const uptr kBufSize = 4095;
>    char buf[kBufSize];
>    uptr offset = 0;
>    uptr frame_pc = 0;
> @@ -340,19 +340,19 @@ bool DescribeAddressIfStack(uptr addr, u
>    PrintStack(&alloca_stack);
>    // Report the number of stack objects.
>    char *p;
> -  s64 n_objects = internal_simple_strtoll(frame_descr, &p, 10);
> +  u64 n_objects = (uptr)internal_simple_strtoll(frame_descr, &p, 10);
>    CHECK_GT(n_objects, 0);
>    Printf("  This frame has %zu object(s):\n", n_objects);
>
>    // Report all objects in this frame.
>    InternalScopedBuffer<StackVarDescr> vars(n_objects);
> -  for (s64 i = 0; i < n_objects; i++) {
> -    s64 beg, size;
> -    s64 len;
> -    beg  = internal_simple_strtoll(p, &p, 10);
> -    size = internal_simple_strtoll(p, &p, 10);
> -    len  = internal_simple_strtoll(p, &p, 10);
> -    if (beg <= 0 || size <= 0 || len < 0 || *p != ' ') {
> +  for (uptr i = 0; i < n_objects; i++) {
> +    uptr beg, size;
> +    uptr len;
> +    beg  = (uptr)internal_simple_strtoll(p, &p, 10);
> +    size = (uptr)internal_simple_strtoll(p, &p, 10);
> +    len  = (uptr)internal_simple_strtoll(p, &p, 10);
> +    if (beg == 0 || size == 0 || *p != ' ') {
>        Printf("AddressSanitizer can't parse the stack frame "
>                   "descriptor: |%s|\n", frame_descr);
>        break;
> @@ -364,7 +364,7 @@ bool DescribeAddressIfStack(uptr addr, u
>      vars[i].name_len = len;
>      p += len;
>    }
> -  for (s64 i = 0; i < n_objects; i++) {
> +  for (uptr i = 0; i < n_objects; i++) {
>      buf[0] = 0;
>      internal_strncat(buf, vars[i].name_pos,
>                       static_cast<uptr>(Min(kBufSize, vars[i].name_len)));
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130903/d2df99f3/attachment.html>


More information about the llvm-commits mailing list