From 28095b2a3e71f80fb1a9ee96ead39be712291521 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Tue, 7 Jun 2016 15:08:50 +0000 Subject: [PATCH] remove redundant casts from JavaScriptCore Signed-off-by: Ivailo Monev --- src/3rdparty/javascriptcore/JavaScriptCore/pcre/pcre_compile.cpp | 7 +++---- src/3rdparty/javascriptcore/JavaScriptCore/yarr/RegexJIT.cpp | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/pcre/pcre_compile.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/pcre/pcre_compile.cpp index ef53f3cba..ce43c7abc 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/pcre/pcre_compile.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/pcre/pcre_compile.cpp @@ -2603,23 +2603,22 @@ JSRegExp* jsRegExpCompile(const UChar* pattern, int patternLength, error, errorcode will be set non-zero, so we don't need to look at the result of the function here. */ - const UChar* ptr = (const UChar*)pattern; const UChar* patternEnd = pattern + patternLength; unsigned char* code = const_cast(codeStart); int firstByte, reqByte; int bracketCount = 0; if (!cd.needOuterBracket) - compileBranch(re->options, &bracketCount, &code, &ptr, patternEnd, &errorcode, &firstByte, &reqByte, cd); + compileBranch(re->options, &bracketCount, &code, &pattern, patternEnd, &errorcode, &firstByte, &reqByte, cd); else { *code = OP_BRA; - compileBracket(re->options, &bracketCount, &code, &ptr, patternEnd, &errorcode, 0, &firstByte, &reqByte, cd); + compileBracket(re->options, &bracketCount, &code, &pattern, patternEnd, &errorcode, 0, &firstByte, &reqByte, cd); } re->topBracket = bracketCount; re->topBackref = cd.topBackref; /* If not reached end of pattern on success, there's an excess bracket. */ - if (errorcode == 0 && ptr < patternEnd) + if (errorcode == 0 && pattern < patternEnd) errorcode = ERR10; /* Fill in the terminating state and check for disastrous overflow, but diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/yarr/RegexJIT.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/yarr/RegexJIT.cpp index 101592375..29f7e3b09 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/yarr/RegexJIT.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/yarr/RegexJIT.cpp @@ -1399,7 +1399,7 @@ void jitCompileRegex(JSGlobalData* globalData, RegexCodeBlock& jitObject, const if (generator.generationFailed()) { JSRegExpIgnoreCaseOption ignoreCaseOption = ignoreCase ? JSRegExpIgnoreCase : JSRegExpDoNotIgnoreCase; JSRegExpMultilineOption multilineOption = multiline ? JSRegExpMultiline : JSRegExpSingleLine; - jitObject.setFallback(jsRegExpCompile(reinterpret_cast(patternString.data()), patternString.size(), ignoreCaseOption, multilineOption, &numSubpatterns, &error)); + jitObject.setFallback(jsRegExpCompile(patternString.data(), patternString.size(), ignoreCaseOption, multilineOption, &numSubpatterns, &error)); } } -- 2.11.0