Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/design/datacontracts/Thread.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,11 @@ TargetPointer IThread.GetThreadLocalStaticBase(TargetPointer threadPointer, Targ
if (collectibleCount > indexOffset)
{
TargetPointer collectibleArray = target.ReadPointer(threadLocalDataPtr + /* ThreadLocalData::CollectibleTlsArrayData offset */);
threadLocalStaticBase = target.ReadPointer(collectibleArray + (ulong)(indexOffset * target.PointerSize));
// The collectible TLS array slot holds an OBJECTHANDLE; dereference the handle to the object
TargetPointer handleSlotAddress = collectibleArray + (ulong)(indexOffset * target.PointerSize);
TargetPointer handle = target.ReadPointer(handleSlotAddress);
if (handle != TargetPointer.Null && target.TryReadPointer(handle, out TargetPointer obj))
threadLocalStaticBase = obj;
}
break;
case TLSIndexType.DirectOnThreadLocalData:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ TargetPointer IThread.GetThreadLocalStaticBase(TargetPointer threadPointer, Targ
if (collectibleCount > indexOffset)
{
TargetPointer collectibleArray = threadLocalData.CollectibleTlsArrayData;
threadLocalStaticBase = _target.ReadPointer(collectibleArray + (ulong)(indexOffset * _target.PointerSize));
TargetPointer handleSlotAddress = collectibleArray + (ulong)(indexOffset * _target.PointerSize);
threadLocalStaticBase = _target.ProcessedData.GetOrAdd<Data.ObjectHandle>(handleSlotAddress).Object;
Comment on lines +219 to +220
}
break;
case TLSIndexType.DirectOnThreadLocalData:
Expand Down
Loading