diff options
author | Samuel Benzaquen <sbenza@google.com> | 2014-10-13 18:17:11 +0000 |
---|---|---|
committer | Samuel Benzaquen <sbenza@google.com> | 2014-10-13 18:17:11 +0000 |
commit | 193d87fd8cdb746f1050d274cac096ba318e2f2b (patch) | |
tree | a769ebbfc64da99e71febc4c8d0eed29003ca5ea | |
parent | 17a00110826da801c32df078432ab442a6c1bd89 (diff) | |
download | bcm5719-llvm-193d87fd8cdb746f1050d274cac096ba318e2f2b.tar.gz bcm5719-llvm-193d87fd8cdb746f1050d274cac096ba318e2f2b.zip |
Fix order of evaluation bug in DynTypedMatcher::constructVariadic().
Fix order of evaluation bug in DynTypedMatcher::constructVariadic().
If it evaluates right-to-left, the vector gets moved before we read the
kind from it.
llvm-svn: 219624
-rw-r--r-- | clang/lib/ASTMatchers/ASTMatchersInternal.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/ASTMatchers/ASTMatchersInternal.cpp b/clang/lib/ASTMatchers/ASTMatchersInternal.cpp index c8e5852475c..9d77cb65767 100644 --- a/clang/lib/ASTMatchers/ASTMatchersInternal.cpp +++ b/clang/lib/ASTMatchers/ASTMatchersInternal.cpp @@ -99,8 +99,8 @@ DynTypedMatcher DynTypedMatcher::constructVariadic( // The different operators might deal differently with a mismatch. // Make it the same as SupportedKind, since that is the broadest type we are // allowed to accept. - return DynTypedMatcher(InnerMatchers[0].SupportedKind, - InnerMatchers[0].SupportedKind, + auto SupportedKind = InnerMatchers[0].SupportedKind; + return DynTypedMatcher(SupportedKind, SupportedKind, new VariadicMatcher(Func, std::move(InnerMatchers))); } |