mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-07 08:33:50 +08:00
The thread record keeps the Worker's name as an immortal string and frees it with the record. worker.threadName and the in-thread threadName returned that buffer as a string value, whose retains do not extend an immortal string's lifetime, so a name read before the Worker was released pointed at freed memory once the record was destroyed. Both getters now copy the name into a new string. Corpus 5992 keeps worker.threadName past the worker's exit and the Worker's release and then uses it; it matches Node, plain and with SCRIPTC_SAN=1, and fails under ASan without this change.