Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb1c1b7a

Browse files
committed
jit: Don't inline functions that access thread-locals.
Code inlined by LLVM can crash or fail with "Relocation type notimplemented yet!" if it tries to access thread local variables. Don'tinline such code.Back-patch to 11, where LLVM arrived. Bug #16696.Author: Dmitry Marakasov <amdmi3@amdmi3.ru>Reviewed-by: Andres Freund <andres@anarazel.de>Discussion:https://postgr.es/m/16696-29d944a33801fbfe@postgresql.org
1 parent227c4e5 commitb1c1b7a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

‎src/backend/jit/llvm/llvmjit_inline.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,17 @@ function_inlinable(llvm::Function &F,
608608
if (rv->materialize())
609609
elog(FATAL,"failed to materialize metadata");
610610

611+
/*
612+
* Don't inline functions that access thread local variables. That
613+
* doesn't work on current LLVM releases (but might in future).
614+
*/
615+
if (rv->isThreadLocal())
616+
{
617+
ilog(DEBUG1,"cannot inline %s due to thread-local variable %s",
618+
F.getName().data(), rv->getName().data());
619+
returnfalse;
620+
}
621+
611622
/*
612623
* Never want to inline externally visible vars, cheap enough to
613624
* reference.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp