summaryrefslogtreecommitdiffstats
path: root/clang/test/Parser/cxx-ambig-paren-expr-asan.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2016-02-04 04:22:09 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2016-02-04 04:22:09 +0000
commit703a93c4e61fd3e1cf7d85d8600d82e2035ac82a (patch)
treedf31f280f7900205b97ee875f78602ec89d716f2 /clang/test/Parser/cxx-ambig-paren-expr-asan.cpp
parentf650441b04069195a2fa757ed4e6b5d85e0b7892 (diff)
downloadbcm5719-llvm-703a93c4e61fd3e1cf7d85d8600d82e2035ac82a.tar.gz
bcm5719-llvm-703a93c4e61fd3e1cf7d85d8600d82e2035ac82a.zip
PR23057: fix use-after-free due to local token buffer in ParseCXXAmbiguousParenExpression, by Dmitry Polukhin
Differential Revision: http://reviews.llvm.org/D16572 A test/Parser/cxx-ambig-paren-expr-asan.cpp M lib/Parse/ParseExprCXX.cpp llvm-svn: 259750
Diffstat (limited to 'clang/test/Parser/cxx-ambig-paren-expr-asan.cpp')
-rw-r--r--clang/test/Parser/cxx-ambig-paren-expr-asan.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/Parser/cxx-ambig-paren-expr-asan.cpp b/clang/test/Parser/cxx-ambig-paren-expr-asan.cpp
new file mode 100644
index 00000000000..ec9d6b9da39
--- /dev/null
+++ b/clang/test/Parser/cxx-ambig-paren-expr-asan.cpp
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s
+
+// This syntax error used to cause use-after free due to token local buffer
+// in ParseCXXAmbiguousParenExpression.
+int H((int()[)]);
+// expected-error@-1 {{expected expression}}
+// expected-error@-2 {{expected ']'}}
+// expected-note@-3 {{to match this '['}}
+// expected-error@-4 {{expected ';' after top level declarator}}
OpenPOWER on IntegriCloud