This is an archive of the discontinued LLVM Phabricator instance.

[clang][PR52088]Fix assertion failure when passing bool as the type of next parameter
AbandonedPublic

Authored by Lucas on Nov 30 2021, 5:28 PM.

Details

Reviewers
curdeius
rsmith
Summary

$cat bad.cpp

void fn1(__builtin_va_list args)
{
  __builtin_va_arg(args, bool);
}

Command output(stderr):
Unexpected unsigned integer or fixed point type
UNREACHABLE executed at /mnt/c/Users/zhaohui/workspace/llvm-project/clang/lib/AST/ASTContext.cpp:10396!
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: ./bin/clang-14 -c bad.cpp

  1. bad.c:6:32: current parser token ';'
  2. bad.c:5:1: parsing function body 'main'
  3. bad.c:5:1: in compound statement ('{}')

    #0 0x00007f3b7e7bce08 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /mnt/c/Users/zhaohui/workspace/llvm-project/llvm/lib/Support/Unix/Signals.inc:565:0 #1 0x00007f3b7e7bcebf PrintStackTraceSignalHandler(void*) /mnt/c/Users/zhaohui/workspace/llvm-project/llvm/lib/Support/Unix/Signals.inc:632:0 #2 0x00007f3b7e7ba919 llvm::sys::RunSignalHandlers() /mnt/c/Users/zhaohui/workspace/llvm-project/llvm/lib/Support/Signals.cpp:97:0 #3 0x00007f3b7e7bc602 llvm::sys::CleanupOnSignal(unsigned long) /mnt/c/Users/zhaohui/workspace/llvm-project/llvm/lib/Support/Unix/Signals.inc:361:0 #4 0x00007f3b7e6d569a (anonymous namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long) /mnt/c/Users/zhaohui/workspace/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:76:0 #5 0x00007f3b7e6d5bb5 CrashRecoverySignalHandler(int) /mnt/c/Users/zhaohui/workspace/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:390:0 #6 0x00007f3b77bf2980 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12980) #7 0x00007f3b76cbefb7 raise (/lib/x86_64-linux-gnu/libc.so.6+0x3efb7) #8 0x00007f3b76cc0921 abort (/lib/x86_64-linux-gnu/libc.so.6+0x40921) #9 0x00007f3b7e6df5bb bindingsErrorHandler(void*, char const*, bool) /mnt/c/Users/zhaohui/workspace/llvm-project/llvm/lib/Support/ErrorHandling.cpp:218:0

#10 0x00007f3b8315a914 clang::ASTContext::getCorrespondingSignedType(clang::QualType) const /mnt/c/Users/zhaohui/workspace/llvm-project/clang/lib/AST/ASTContext.cpp:10398:0
#11 0x00007f3b822bc270 clang::Sema::BuildVAArgExpr(clang::SourceLocation, clang::Expr*, clang::TypeSourceInfo*, clang::SourceLocation) /mnt/c/Users/zhaohui/workspace/llvm-project/clang/lib/Sema/SemaExpr.cpp:15911:0
#12 0x00007f3b822bb812 clang::Sema::ActOnVAArg(clang::SourceLocation, clang::Expr*, clang::OpaquePtr<clang::QualType>, clang::SourceLocation) /mnt/c/Users/zhaohui/workspace/llvm-project/clang/lib/Sema/SemaExpr.cpp:15779:0
clang-14: error: clang frontend command failed with exit code 134 (use -v to see invocation)
clang version 14.0.0 (https://github.com/llvm/llvm-project.git d32a43d2c13d22f27d7381f8aff9f39e129ee03b)

https://bugs.llvm.org/show_bug.cgi?id=52088

Diff Detail

Event Timeline

Lucas requested review of this revision.Nov 30 2021, 5:28 PM
Lucas created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptNov 30 2021, 5:28 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
Lucas retitled this revision from [clang]Fix assertion failure when passing bool as the type of next parameter to [clang][PR52088]Fix assertion failure when passing bool as the type of next parameter.Nov 30 2021, 5:33 PM
Lucas edited the summary of this revision. (Show Details)
Lucas added a reviewer: curdeius.
Lucas edited the summary of this revision. (Show Details)Nov 30 2021, 5:36 PM
Lucas added a reviewer: rsmith.
Lucas edited the summary of this revision. (Show Details)Nov 30 2021, 5:54 PM
Lucas updated this revision to Diff 390886.Nov 30 2021, 7:17 PM

Checking with clang-format.

Lucas updated this revision to Diff 390889.Nov 30 2021, 7:28 PM

Include all local changes.

Lucas abandoned this revision.May 31 2022, 6:35 AM

This issue has already been fixed by https://reviews.llvm.org/D116272.

Herald added a project: Restricted Project. · View Herald TranscriptMay 31 2022, 6:35 AM
Herald added a subscriber: jsji. · View Herald Transcript