diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-01-27 21:28:37 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-01-27 21:28:37 +0000 |
| commit | 78aacbe2f9e26ba327a5d97e6e79f24b547db8c6 (patch) | |
| tree | d7164d206e1e73638941526ba6d50f1ed9e63082 /clang/lib/Sema/SemaDecl.cpp | |
| parent | 35ce5dac7fc1bf30fe7c9378ae8986439af1516e (diff) | |
| download | bcm5719-llvm-78aacbe2f9e26ba327a5d97e6e79f24b547db8c6.tar.gz bcm5719-llvm-78aacbe2f9e26ba327a5d97e6e79f24b547db8c6.zip | |
PR31783: Don't request the alignment of an invalid declaration.
Fixes an assertion failure on PS4 targets.
llvm-svn: 293333
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 3ed6ede53cf..ce843a587b7 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -10930,7 +10930,8 @@ Sema::FinalizeDeclaration(Decl *ThisDecl) { if (unsigned MaxAlign = Context.getTargetInfo().getMaxTLSAlign()) { // Protect the check so that it's not performed on dependent types and // dependent alignments (we can't determine the alignment in that case). - if (VD->getTLSKind() && !hasDependentAlignment(VD)) { + if (VD->getTLSKind() && !hasDependentAlignment(VD) && + !VD->isInvalidDecl()) { CharUnits MaxAlignChars = Context.toCharUnitsFromBits(MaxAlign); if (Context.getDeclAlign(VD) > MaxAlignChars) { Diag(VD->getLocation(), diag::err_tls_var_aligned_over_maximum) |

