diff options
author | Pavel Labath <labath@google.com> | 2013-06-19 08:19:56 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2013-06-19 08:19:56 +0000 |
commit | 963f91b3a2b2b3b3a2f34e41333d19e3d79f1017 (patch) | |
tree | e54e868024c6a595fd8d415e66fa5137724e6ee6 /clang/test/Analysis/inline.c | |
parent | a7cc1243cc6cbeef725ef6883d49c29630c52511 (diff) | |
download | bcm5719-llvm-963f91b3a2b2b3b3a2f34e41333d19e3d79f1017.tar.gz bcm5719-llvm-963f91b3a2b2b3b3a2f34e41333d19e3d79f1017.zip |
Fix a crash in the static analyzer (bug #16307)
Summary:
When processing a call to a function, which got passed less arguments than it
expects, the analyzer would crash.
I've also added a test for that and a analyzer warning which detects these
cases.
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D994
llvm-svn: 184288
Diffstat (limited to 'clang/test/Analysis/inline.c')
-rw-r--r-- | clang/test/Analysis/inline.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/test/Analysis/inline.c b/clang/test/Analysis/inline.c index 8cba63f17e0..9ecdce33a36 100644 --- a/clang/test/Analysis/inline.c +++ b/clang/test/Analysis/inline.c @@ -110,3 +110,9 @@ void never_called_by_anyone() { clang_analyzer_checkInlined(0); // no-warning } + +void knr_one_argument(a) int a; { } + +void call_with_less_arguments() { + knr_one_argument(); // expected-warning{{too few arguments}} expected-warning{{Function taking 1 argument}} +} |