Skip to content

Commit 41595fb

Browse files
committed
[1.9>master] [1.8>1.9] [MERGE chakra-core#4681 @leirocks] more xdata fix for debugger attaching/detaching
Merge pull request chakra-core#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 79ab6f9 + 22f9ab8 commit 41595fb

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

lib/Runtime/Base/ScriptContext.cpp

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

3195+
#if ENABLE_NATIVE_CODEGEN
3196+
#if PDATA_ENABLED && defined(_WIN32)
3197+
// RundownSourcesAndReparse can cause code generation immediately, clear the leftovers if background thread didn't finish the work
3198+
DelayDeletingFunctionTable::Clear();
3199+
#endif
3200+
#endif
3201+
31953202
hr = this->GetDebugContext()->RundownSourcesAndReparse(shouldPerformSourceRundown, /*shouldReparseFunctions*/ true);
31963203

31973204
if (this->IsClosed())
@@ -3318,6 +3325,13 @@ namespace Js
33183325
// Disable QC while functions are re-parsed as this can be time consuming
33193326
AutoDisableInterrupt autoDisableInterrupt(this->threadContext, false /* explicitCompletion */);
33203327

3328+
#if ENABLE_NATIVE_CODEGEN
3329+
#if PDATA_ENABLED && defined(_WIN32)
3330+
// RundownSourcesAndReparse can cause code generation immediately, clear the leftovers if background thread didn't finish the work
3331+
DelayDeletingFunctionTable::Clear();
3332+
#endif
3333+
#endif
3334+
33213335
// Force a reparse so that indirect function caches are updated.
33223336
hr = this->GetDebugContext()->RundownSourcesAndReparse(/*shouldPerformSourceRundown*/ false, /*shouldReparseFunctions*/ true);
33233337

0 commit comments

Comments
 (0)