From 0e367bc76f23d6d876caa00a47700b3634402817 Mon Sep 17 00:00:00 2001 From: Arun Banala Date: Tue, 23 Apr 2019 11:55:37 +0100 Subject: SERVER-40083 Rename 'pcre' variable to fix compile issue becase of typedef conflict --- src/mongo/db/pipeline/expression.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/mongo/db/pipeline/expression.cpp') diff --git a/src/mongo/db/pipeline/expression.cpp b/src/mongo/db/pipeline/expression.cpp index 8b6b00739e4..ec0a0d8f435 100644 --- a/src/mongo/db/pipeline/expression.cpp +++ b/src/mongo/db/pipeline/expression.cpp @@ -5747,9 +5747,9 @@ RegexMatchHandler::RegexExecutionState RegexMatchHandler::buildInitialState( int RegexMatchHandler::execute(RegexExecutionState* regexState) const { invariant(regexState); invariant(!regexState->nullish()); - invariant(regexState->pcre); + invariant(regexState->pcrePtr); - int execResult = pcre_exec(regexState->pcre.get(), + int execResult = pcre_exec(regexState->pcrePtr.get(), 0, regexState->input->c_str(), regexState->input->size(), @@ -5829,15 +5829,15 @@ void RegexMatchHandler::_compile(RegexExecutionState* executionState) const { // The C++ interface pcreccp.h doesn't have a way to capture the matched string (or the index of // the match). So we are using the C interface. First we compile all the regex options to // generate pcre object, which will later be used to match against the input string. - executionState->pcre = std::shared_ptr( + executionState->pcrePtr = std::shared_ptr( pcre_compile( executionState->pattern->c_str(), pcreOptions, &compile_error, &eoffset, nullptr), pcre_free); - uassert(51111, str::stream() << "Invalid Regex: " << compile_error, executionState->pcre); + uassert(51111, str::stream() << "Invalid Regex: " << compile_error, executionState->pcrePtr); // Calculate the number of capture groups present in 'pattern' and store in 'numCaptures'. const int pcre_retval = pcre_fullinfo( - executionState->pcre.get(), NULL, PCRE_INFO_CAPTURECOUNT, &executionState->numCaptures); + executionState->pcrePtr.get(), NULL, PCRE_INFO_CAPTURECOUNT, &executionState->numCaptures); invariant(pcre_retval == 0); // The first two-thirds of the vector is used to pass back captured substrings' start and -- cgit v1.2.1