llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

type_tag_for_datatype causes clang to crash in some cases.

Open goussepi opened this issue 10 years ago • 1 comments

Bugzilla Link 28520
Resolution FIXED
Resolved on Nov 29, 2017 19:49
Version trunk
OS All
CC @hfinkel

Extended Description

Use of type_tag_for_datatype causes clang to crash in some cases.

clang 3.9 trunk@r275160 Target: x86_64-unknown-linux-gnu


static const int test_void attribute((type_tag_for_datatype (test, void))) = 0; #define TEST_VOID 0

void test(int datatype, ...) attribute((argument_with_type_tag(test,2,1)));

int main() { test(TEST_VOID); return 0; }

clang -c test.c #​0 0x000000000129a165 llvm::sys::PrintStackTrace(llvm::raw_ostream&) #​1 0x00000000012980ce llvm::sys::RunSignalHandlers() #​2 0x0000000001298232 SignalHandler(int) #​3 0x00007fb061f86340 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x10340) #​4 0x0000000001f4caba clang::Sema::CheckArgumentWithTypeTag(clang::ArgumentWithTypeTagAttr const*, clang::Expr const* const*) ... Stack dump: 0. Program arguments: clang-3.9 -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name tag.c -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -coverage-file lab/tag.c -resource-dir llvm/install/bin/../lib/clang/3.9.0 -internal-isystem /usr/local/include -internal-isystem llvm/install/bin/../lib/clang/3.9.0/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdebug-compilation-dir lab -ferror-limit 19 -fmessage-length 168 -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -o tag.o -x c tag.c

  1.  tag.c:10:17: current parser token ')'
    
  2.  tag.c:9:12: parsing function body 'main'
    
  3.  tag.c:9:12: in compound statement ('{}')
    

goussepi avatar Jul 12 '16 16:07 goussepi

This should now be fixed with r319383 http://llvm.org/viewvc/llvm-project?view=revision&revision=319383

llvmbot avatar Nov 30 '17 03:11 llvmbot