type_tag_for_datatype causes clang to crash in some cases.
| 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
-
tag.c:10:17: current parser token ')' -
tag.c:9:12: parsing function body 'main' -
tag.c:9:12: in compound statement ('{}')
This should now be fixed with r319383 http://llvm.org/viewvc/llvm-project?view=revision&revision=319383