This repository has been archived by the owner on Oct 15, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 339
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
deps: update ChakraCore to chakra-core/ChakraCore@d7d99e1dbe
[1.8>1.9] [MERGE #4535 @meg-gupta] Fix setting hasBailout when there are inlined functions in try/catch Merge pull request #4535 from meg-gupta:fixCatchEatingUpEx Fixes OS#15078638 When we bailout executing trycode from within OP_TryCatch, we complete the execution of the current function enclosing the try/catch in the interpreter. If there was an exception within the try region, it is caught and handled accordingly in ProcessTryHandlerBailOut which reconstructs try/catch/finally frames when we bailout midway executing code within OP_TryCatch. If there was an exception outside the try region, the catch of the OP_TryCatch ends up catching it, because it happens to be on the callstack. For this we use the hasBailOut bit which is per function, so we know that this exception has to be passed above. When we have inlined functions inside the try, and for bailouts inside the inlined code, we do not set the hasBailedOut bit, so that the enclosing functions catch in OP_TryCatch catches it. But when we bailout from inlined code inside try, we execute inlined code, as well as the enclosing function's code in the interpreter. We will be execution code past the try/catch of the current function in the interpreter. Now if any code outside the eh region throws, we will catch that in OP_TryCatch which happens to be on the callstack. And we will end up handling it instead of passing above because we have not set the hasBailedOutBit from the bailout point. This change fixes this issue. We pass a pointer to the hasBailedOutBit and set it once we have finished executing the inlined frames and are ready to process the interpreter frame of the current function. Reviewed-By: chakrabot <chakrabot@users.noreply.github.com>
- Loading branch information
Showing
7 changed files
with
106 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
TypeError: Assignment to read-only properties is not allowed in strict mode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
//------------------------------------------------------------------------------------------------------- | ||
// Copyright (C) Microsoft. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. | ||
//------------------------------------------------------------------------------------------------------- | ||
|
||
var shouldBailout = false; | ||
function test0() { | ||
var obj0 = {}; | ||
var func0 = function () { | ||
}; | ||
var func1 = function () { | ||
(function () { | ||
'use strict'; | ||
try { | ||
function func8() { | ||
obj0.prop2; | ||
} | ||
var uniqobj4 = func8(); | ||
} catch (ex) { | ||
return 'somestring'; | ||
} finally { | ||
} | ||
func0(ary.push(ary.unshift(Object.prototype.length = protoObj0))); | ||
}(shouldBailout ? (Object.defineProperty(Object.prototype, 'length', { | ||
get: function () { | ||
} | ||
})) : arguments)); | ||
}; | ||
var ary = Array(); | ||
var protoObj0 = Object(); | ||
({ | ||
prop7: shouldBailout ? (Object.defineProperty(obj0, 'prop2', { | ||
set: function () { | ||
} | ||
})) : Object | ||
}); | ||
for (; func1(); ) { | ||
} | ||
} | ||
test0(); | ||
test0(); | ||
shouldBailout = true; | ||
try { | ||
test0(); | ||
} | ||
catch(ex) { | ||
print(ex); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters