Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
deps: update ChakraCore to chakra-core/ChakraCore@156a58e6f4
Browse files Browse the repository at this point in the history
Merged PR 96029: Reduce the scope of a fix to address a perf bug

The change to do this got undone by a fullsync issue when it was done in dev3 (https://microsoft.visualstudio.com/_git/os/commit/6933d4be4f827062c7b62b5f694001efc4891162), and in the meanwhile the macros were removed with the 1711 public release branch merge. In order to get everything into the right state, I'm targeting this at the same branch as the 1711 release.

Reviewed-By: chakrabot <chakrabot@users.noreply.github.com>
  • Loading branch information
Penguinwizzard authored and chakrabot committed Dec 1, 2017
1 parent 223a260 commit 229ecfe
Showing 1 changed file with 10 additions and 25 deletions.
35 changes: 10 additions & 25 deletions deps/chakrashim/core/lib/Parser/Scan.h
Original file line number Diff line number Diff line change
Expand Up @@ -481,14 +481,9 @@ class Scanner : public IScanner, public EncodingPolicy
charcount_t IchMinTok(void) const
{

AssertOrFailFast(m_pchMinTok - m_pchBase >= 0);
AssertOrFailFast(m_pchMinTok - m_pchBase <= LONG_MAX);
if (static_cast<charcount_t>(m_pchMinTok - m_pchBase) < m_cMinTokMultiUnits)
{
AssertMsg(false, "IchMinTok subtraction overflow");
return 0;
}

Assert(m_pchMinTok - m_pchBase >= 0);
Assert(m_pchMinTok - m_pchBase <= LONG_MAX);
Assert(static_cast<charcount_t>(m_pchMinTok - m_pchBase) >= m_cMinTokMultiUnits);
return static_cast<charcount_t>(m_pchMinTok - m_pchBase - m_cMinTokMultiUnits);
}

Expand All @@ -497,15 +492,10 @@ class Scanner : public IScanner, public EncodingPolicy
charcount_t IchLimTok(void) const
{

AssertOrFailFast(m_currentCharacter - m_pchBase >= 0);
AssertOrFailFast(m_currentCharacter - m_pchBase <= LONG_MAX);
if (static_cast<charcount_t>(m_currentCharacter - m_pchBase) < this->m_cMultiUnits)
{
AssertMsg(false, "IchLimTok subtraction overflow");
return 0;
}

return static_cast< charcount_t >(m_currentCharacter - m_pchBase - this->m_cMultiUnits);
Assert(m_currentCharacter - m_pchBase >= 0);
Assert(m_currentCharacter - m_pchBase <= LONG_MAX);
Assert(static_cast<charcount_t>(m_currentCharacter - m_pchBase) >= this->m_cMultiUnits);
return static_cast<charcount_t>(m_currentCharacter - m_pchBase - this->m_cMultiUnits);
}

void SetErrorPosition(charcount_t ichMinError, charcount_t ichLimError)
Expand Down Expand Up @@ -557,14 +547,9 @@ class Scanner : public IScanner, public EncodingPolicy
charcount_t IchMinLine(void) const
{

AssertOrFailFast(m_pchMinLine - m_pchBase >= 0);
AssertOrFailFast(m_pchMinLine - m_pchBase <= LONG_MAX);
if (static_cast<charcount_t>(m_pchMinLine - m_pchBase) < m_cMinLineMultiUnits)
{
AssertMsg(false, "IchMinLine subtraction overflow");
return 0;
}

Assert(m_pchMinLine - m_pchBase >= 0);
Assert(m_pchMinLine - m_pchBase <= LONG_MAX);
Assert(static_cast<charcount_t>(m_pchMinLine - m_pchBase) >= m_cMinLineMultiUnits);
return static_cast<charcount_t>(m_pchMinLine - m_pchBase - m_cMinLineMultiUnits);
}

Expand Down

0 comments on commit 229ecfe

Please sign in to comment.