Skip to content

Commit e26c81f

Browse files
authored
Correct ifdef for arm64 (#6995)
JsDisableRuntimeExecution currently does not function on AppleSilicon. This is because of an incorrect ifdef, JsDisableRuntimeExecution works by overriding CC's stack size tracking so that CC mistakenly thinks there is no stack space left and hence stops executing JS; in order to do this StackLimitForScriptInterrupt needs to be an appropriately large number for the architecture, currently it's being set to the same size on AppleSilicon that was used for x86 which is obviously not high enough, change the ifdef so all 64bit architectures (i.e. x64 and AppleSilicon) get the larger figure. Bug reported by @fatcerberus fix also tested offline by @fatcerberus Currently most of our native API tests only run on windows hence do not detect this; we should look at enabling them on macOS/Linux as a future todo.
1 parent 13358c6 commit e26c81f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Runtime/Base/Constants.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//-------------------------------------------------------------------------------------------------------
22
// Copyright (C) Microsoft. All rights reserved.
3+
// Copyright (c) ChakraCore Project Contributors. All rights reserved.
34
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
45
//-------------------------------------------------------------------------------------------------------
56
#include "RuntimeBasePch.h"
@@ -29,7 +30,7 @@ const char16 Constants::StringMatch[] = _u("String.prototype.match");
2930
const uint64 Constants::ExponentMask = 0x3FF0000000000000;
3031
const uint64 Constants::MantissaMask = 0x000FFFFFFFFFFFFF;
3132

32-
#ifdef _M_AMD64
33+
#ifdef TARGET_64
3334
const size_t Constants::StackLimitForScriptInterrupt = 0x7fffffffffffffff;
3435
#else
3536
const size_t Constants::StackLimitForScriptInterrupt = 0x7fffffff;

0 commit comments

Comments
 (0)