[all-commits] [llvm/llvm-project] b84fd8: Add boundary check for ASTUnresolvedSet::erase
Zhouyi Zhou via All-commits
all-commits at lists.llvm.org
Sun Nov 6 15:07:56 PST 2022
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: b84fd822fa7eeaec2bb084a26caa9e41f3495923
https://github.com/llvm/llvm-project/commit/b84fd822fa7eeaec2bb084a26caa9e41f3495923
Author: Zhouyi Zhou <zhouzhouyi at gmail.com>
Date: 2022-11-06 (Sun, 06 Nov 2022)
Changed paths:
M clang/include/clang/AST/ASTUnresolvedSet.h
M clang/test/SemaCXX/using-decl-templates.cpp
Log Message:
-----------
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
More information about the All-commits
mailing list