diff --git a/includes/_withcontent.vp b/includes/_withcontent.vp index 6036313..4bd7bd7 100644 --- a/includes/_withcontent.vp +++ b/includes/_withcontent.vp @@ -26,10 +26,9 @@ _tls_index: ULONG = 0 def _init_tls(): """Initialize TLS index (executes once; subsequent calls are skipped).""" global _tls_index - # TPV 未实现 @t.TLS 的"首次执行"守卫(函数每次调用都执行体), - # 不加守卫会导致每次 _get_stack 都 TlsAlloc 新索引 → 每次拿到新 - # 空栈 → push/find 各用各的栈,provider 永远匹配失败。_tls_index - # 初始为 0(TlsAlloc 成功不会返回 0),以此判重即等价 TLS 语义。 + # 双保险:TPV 已正式实现 @t.TLS(函数级一次性守卫,首次执行后置 + # __tls_init_done 标志,后续调用直接返回),此判重守卫保留以兼容 + # 尚未重建的旧 TPV.exe。_tls_index 初始为 0(TlsAlloc 成功不会返回 0)。 if _tls_index == 0: _tls_index = TlsAlloc()