Merge pull request #8633 from inclyc/libexpr/fix-data-race-in-lexer.l

libexpr: use `thread_local` to make the parser thread-safe
This commit is contained in:
Eelco Dolstra 2023-07-03 13:29:47 +02:00 committed by GitHub
commit 2898dc71a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -36,7 +36,7 @@ static inline PosIdx makeCurPos(const YYLTYPE & loc, ParseData * data)
#define CUR_POS makeCurPos(*yylloc, data)
// backup to recover from yyless(0)
YYLTYPE prev_yylloc;
thread_local YYLTYPE prev_yylloc;
static void initLoc(YYLTYPE * loc)
{