Skip to content

Commit 88560a1

Browse files
committed
[MERGE #5303 @dilijev] OS#16526968: Improve assert to improve attribution.
Merge pull request #5303 from dilijev:improve-oomhandle-assert
2 parents 2f372ca + 11316c9 commit 88560a1

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

lib/Common/Exceptions/ExceptionCheck.cpp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,14 @@ void ExceptionCheck::SetHandledExceptionType(ExceptionType e)
5555
{
5656
Assert((e & ExceptionType_DisableCheck) == 0 || e == ExceptionType_DisableCheck);
5757
Assert(IsEmpty());
58-
#if DBG
59-
if(!(e == ExceptionType_None ||
60-
e == ExceptionType_DisableCheck ||
61-
!JsUtil::ExternalApi::IsScriptActiveOnCurrentThreadContext() ||
62-
(e & ExceptionType_JavascriptException) == ExceptionType_JavascriptException ||
63-
e == ExceptionType_HasStackProbe))
64-
{
65-
Assert(false);
66-
}
67-
#endif
58+
59+
// If script is active, we don't want any scope to try to handle OOM on its own, just let script handle it.
60+
Assert(e == ExceptionType_None ||
61+
e == ExceptionType_DisableCheck ||
62+
!JsUtil::ExternalApi::IsScriptActiveOnCurrentThreadContext() ||
63+
(e & ExceptionType_JavascriptException) == ExceptionType_JavascriptException ||
64+
e == ExceptionType_HasStackProbe);
65+
6866
data.handledExceptionType = e;
6967
}
7068

0 commit comments

Comments
 (0)