[cfe-commits] r140542 - in /cfe/trunk: lib/AST/ASTContext.cpp test/CodeGenObjCXX/encode.mm
Nico Weber
thakis at chromium.org
Mon Sep 26 17:50:38 PDT 2011
Thanks!
On Mon, Sep 26, 2011 at 11:14 AM, Argyrios Kyrtzidis <akyrtzi at gmail.com> wrote:
> Author: akirtzidis
> Date: Mon Sep 26 13:14:24 2011
> New Revision: 140542
>
> URL: http://llvm.org/viewvc/llvm-project?rev=140542&view=rev
> Log:
> Fix assertion hit when @encoding C++ classes. rdar://10172840 & http://llvm.org/PR10990
>
> Modified:
> cfe/trunk/lib/AST/ASTContext.cpp
> cfe/trunk/test/CodeGenObjCXX/encode.mm
>
> Modified: cfe/trunk/lib/AST/ASTContext.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=140542&r1=140541&r2=140542&view=diff
> ==============================================================================
> --- cfe/trunk/lib/AST/ASTContext.cpp (original)
> +++ cfe/trunk/lib/AST/ASTContext.cpp Mon Sep 26 13:14:24 2011
> @@ -4583,8 +4583,9 @@
> if (base->isEmpty())
> continue;
> uint64_t offs = layout.getVBaseClassOffsetInBits(base);
> - FieldOrBaseOffsets.insert(FieldOrBaseOffsets.upper_bound(offs),
> - std::make_pair(offs, base));
> + if (FieldOrBaseOffsets.find(offs) == FieldOrBaseOffsets.end())
> + FieldOrBaseOffsets.insert(FieldOrBaseOffsets.end(),
> + std::make_pair(offs, base));
> }
> }
>
>
> Modified: cfe/trunk/test/CodeGenObjCXX/encode.mm
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjCXX/encode.mm?rev=140542&r1=140541&r2=140542&view=diff
> ==============================================================================
> --- cfe/trunk/test/CodeGenObjCXX/encode.mm (original)
> +++ cfe/trunk/test/CodeGenObjCXX/encode.mm Mon Sep 26 13:14:24 2011
> @@ -167,3 +167,23 @@
>
> // CHECK: @_ZL2g5 = internal constant [32 x i8] c"{basic_string={_Alloc_hider=*}}\00"
> const char g5[] = @encode(basic_string);
> +
> +
> +// PR10990
> +class CefBase {
> + virtual ~CefBase() {}
> +};
> +class CefBrowser : public virtual CefBase {};
> +class CefBrowserImpl : public CefBrowser {};
> +// CHECK: @_ZL2g6 = internal constant [21 x i8] c"{CefBrowserImpl=^^?}\00"
> +const char g6[] = @encode(CefBrowserImpl);
> +
> +// PR10990_2
> +class CefBase2 {
> + virtual ~CefBase2() {}
> + int i;
> +};
> +class CefBrowser2 : public virtual CefBase2 {};
> +class CefBrowserImpl2 : public CefBrowser2 {};
> +// CHECK: @_ZL2g7 = internal constant [26 x i8] c"{CefBrowserImpl2=^^?^^?i}\00"
> +const char g7[] = @encode(CefBrowserImpl2);
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
More information about the cfe-commits
mailing list