r306692 - Initialize variable and silence potentially uninitialized warning.

Vassil Vassilev via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 30 01:42:23 PDT 2017


On 30/06/17 01:03, Evgenii Stepanov wrote:
> This change broke clang/ubsan bot.
> http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/6047/steps/check-clang%20ubsan/logs/stdio
>
> It looks like the value you are initializing SavedAK with may itself 
> be uninitialized? I see a few constructors that do not mention it.
Indeed. Do you have a solution in mind? The only way I see to fix this 
is by using an llvm::Optional.
>
>
> On Thu, Jun 29, 2017 at 9:08 AM, Vassil Vassilev via cfe-commits 
> <cfe-commits at lists.llvm.org <mailto:cfe-commits at lists.llvm.org>> wrote:
>
>     Author: vvassilev
>     Date: Thu Jun 29 09:08:10 2017
>     New Revision: 306692
>
>     URL: http://llvm.org/viewvc/llvm-project?rev=306692&view=rev
>     <http://llvm.org/viewvc/llvm-project?rev=306692&view=rev>
>     Log:
>     Initialize variable and silence potentially uninitialized warning.
>
>     Patch by Liza Sakellari!
>
>     Modified:
>         cfe/trunk/include/clang/Sema/Lookup.h
>
>     Modified: cfe/trunk/include/clang/Sema/Lookup.h
>     URL:
>     http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Lookup.h?rev=306692&r1=306691&r2=306692&view=diff
>     <http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Lookup.h?rev=306692&r1=306691&r2=306692&view=diff>
>     ==============================================================================
>     --- cfe/trunk/include/clang/Sema/Lookup.h (original)
>     +++ cfe/trunk/include/clang/Sema/Lookup.h Thu Jun 29 09:08:10 2017
>     @@ -465,10 +465,9 @@ public:
>              Paths = nullptr;
>            }
>          } else {
>     -      AmbiguityKind SavedAK;
>     +      AmbiguityKind SavedAK = Ambiguity;
>            bool WasAmbiguous = false;
>            if (ResultKind == Ambiguous) {
>     -        SavedAK = Ambiguity;
>              WasAmbiguous = true;
>            }
>            ResultKind = Found;
>
>
>     _______________________________________________
>     cfe-commits mailing list
>     cfe-commits at lists.llvm.org <mailto:cfe-commits at lists.llvm.org>
>     http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>     <http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170630/a20c66af/attachment.html>


More information about the cfe-commits mailing list