Commit 5912d63a authored by Igor Sheludko's avatar Igor Sheludko Committed by V8 LUCI CQ

[platform] Speculatively fix fast TLS implementation

... for 32-bit Windows.

When the TLS value is not set the TlsExpansionSlots field of the TEB
struct might be NULL in which case the InternalGetExistingThreadLocal
should return NULL too.

Bug: v8:12653
Change-Id: Ic6c6d8e51e2447551c372720fad0967e9201f3dc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3513835
Auto-Submit: Igor Sheludko <ishell@chromium.org>
Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79437}
parent e8975111
......@@ -85,7 +85,7 @@ inline intptr_t InternalGetExistingThreadLocal(intptr_t index) {
__readfsdword(kTibInlineTlsOffset + kSystemPointerSize * index));
}
intptr_t extra = static_cast<intptr_t>(__readfsdword(kTibExtraTlsOffset));
DCHECK_NE(extra, 0);
if (!extra) return 0;
return *reinterpret_cast<intptr_t*>(extra + kSystemPointerSize *
(index - kMaxInlineSlots));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment