Skip to content
Commit b84fd822 authored by Zhouyi Zhou's avatar Zhouyi Zhou Committed by Fangrui Song
Browse files

Add boundary check for ASTUnresolvedSet::erase

When compile following code with clang (Debug build), Assertion will be triggered.

```
struct A
{
        struct Nested {};
        operator Nested*() {return 0;};
};

struct B : A
{
        using A::operator typename A::Nested*;
        operator typename A::Nested *() {
                struct A * thi = this;
                return *thi;
        };
};
```

The assertion fail is caused by: `void erase(unsigned I) { Decls[I] = Decls.pop_back_val(); }` when size of `Decls` is 1 before erase.

Reviewed By: rjmccall, MaskRay

Differential Revision: https://reviews.llvm.org/D137263
parent 7987a0da
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment