@@ -310,6 +310,7 @@ void InterpreterThunkEmitter::NewThunkBlock()
310
310
intptr_t epilogEnd;
311
311
#endif
312
312
313
+ DWORD count = this ->thunkCount ;
313
314
FillBuffer (
314
315
this ->scriptContext ->GetThreadContext (),
315
316
this ->isAsmInterpreterThunk ,
@@ -320,7 +321,7 @@ void InterpreterThunkEmitter::NewThunkBlock()
320
321
&pdataStart,
321
322
&epilogEnd,
322
323
#endif
323
- &this -> thunkCount
324
+ &count
324
325
);
325
326
326
327
if (!emitBufferManager.CommitReadWriteBufferForInterpreter (allocation, buffer, BlockSize))
@@ -341,6 +342,7 @@ void InterpreterThunkEmitter::NewThunkBlock()
341
342
Unused (block);
342
343
#endif
343
344
this ->thunkBuffer = buffer;
345
+ this ->thunkCount = count;
344
346
}
345
347
346
348
#ifdef ENABLE_OOP_NATIVE_CODEGEN
@@ -355,24 +357,25 @@ void InterpreterThunkEmitter::NewOOPJITThunkBlock()
355
357
JITManager::HandleServerCallResult (hr);
356
358
357
359
358
- this -> thunkBuffer = (BYTE*)thunkInfo.thunkBlockAddr ;
360
+ BYTE* buffer = (BYTE*)thunkInfo.thunkBlockAddr ;
359
361
360
362
if (!CONFIG_FLAG (OOPCFGRegistration))
361
363
{
362
- this ->scriptContext ->GetThreadContext ()->SetValidCallTargetForCFG (this -> thunkBuffer );
364
+ this ->scriptContext ->GetThreadContext ()->SetValidCallTargetForCFG (buffer );
363
365
}
364
366
365
367
// Update object state only at the end when everything has succeeded - and no exceptions can be thrown.
366
- auto block = this ->thunkBlocks .PrependNode (allocator, this -> thunkBuffer );
368
+ auto block = this ->thunkBlocks .PrependNode (allocator, buffer );
367
369
#if PDATA_ENABLED
368
370
void * pdataTable;
369
- PDataManager::RegisterPdata ((PRUNTIME_FUNCTION)thunkInfo.pdataTableStart , (ULONG_PTR)this -> thunkBuffer , (ULONG_PTR)thunkInfo.epilogEndAddr , &pdataTable);
371
+ PDataManager::RegisterPdata ((PRUNTIME_FUNCTION)thunkInfo.pdataTableStart , (ULONG_PTR)buffer , (ULONG_PTR)thunkInfo.epilogEndAddr , &pdataTable);
370
372
block->SetPdata (pdataTable);
371
373
#else
372
374
Unused (block);
373
375
#endif
374
376
375
377
this ->thunkCount = thunkInfo.thunkCount ;
378
+ this ->thunkBuffer = (BYTE*)thunkInfo.thunkBlockAddr ;
376
379
}
377
380
#endif
378
381
0 commit comments