Skip to content

Commit 22f9ab8

Browse files
committed
[1.8>1.9] [MERGE #4681 @leirocks] more xdata fix for debugger attaching/detaching
Merge pull request #4681 from leirocks:xdatadebugger codegen can happen before OnDebuggerAttach/Detach returns, we need to clear the function table before the code gen happens.
2 parents 56d4855 + b7b4da8 commit 22f9ab8

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

lib/Runtime/Base/ScriptContext.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3156,6 +3156,13 @@ namespace Js
31563156
// Disable QC while functions are re-parsed as this can be time consuming
31573157
AutoDisableInterrupt autoDisableInterrupt(this->threadContext, false /* explicitCompletion */);
31583158

3159+
#if ENABLE_NATIVE_CODEGEN
3160+
#if PDATA_ENABLED && defined(_WIN32)
3161+
// RundownSourcesAndReparse can cause code generation immediately, clear the leftovers if background thread didn't finish the work
3162+
DelayDeletingFunctionTable::Clear();
3163+
#endif
3164+
#endif
3165+
31593166
hr = this->GetDebugContext()->RundownSourcesAndReparse(shouldPerformSourceRundown, /*shouldReparseFunctions*/ true);
31603167

31613168
if (this->IsClosed())
@@ -3282,6 +3289,13 @@ namespace Js
32823289
// Disable QC while functions are re-parsed as this can be time consuming
32833290
AutoDisableInterrupt autoDisableInterrupt(this->threadContext, false /* explicitCompletion */);
32843291

3292+
#if ENABLE_NATIVE_CODEGEN
3293+
#if PDATA_ENABLED && defined(_WIN32)
3294+
// RundownSourcesAndReparse can cause code generation immediately, clear the leftovers if background thread didn't finish the work
3295+
DelayDeletingFunctionTable::Clear();
3296+
#endif
3297+
#endif
3298+
32853299
// Force a reparse so that indirect function caches are updated.
32863300
hr = this->GetDebugContext()->RundownSourcesAndReparse(/*shouldPerformSourceRundown*/ false, /*shouldReparseFunctions*/ true);
32873301

0 commit comments

Comments
 (0)