]> git.ipfire.org Git - thirdparty/vim.git/commit
patch 9.1.2039: if_ruby: crash when using Ruby/dyn 4.0 v9.1.2039
authorYee Cheng Chin <ychin.git@gmail.com>
Thu, 1 Jan 2026 16:25:10 +0000 (16:25 +0000)
committerChristian Brabandt <cb@256bit.org>
Thu, 1 Jan 2026 16:25:10 +0000 (16:25 +0000)
commit871d2cc2ef4e32b091368a9b1e197b00ff664f08
tree673b9f37f6acdd0a02b2ae65867164d4ed9815ea
parent4fe7301df9bd02308cbea043f58aed56bf4639da
patch 9.1.2039: if_ruby: crash when using Ruby/dyn 4.0

Problem:  if_ruby: crash when using Ruby/dyn 4.0
          (after v9.1.2036)
Solution: Fix Ruby 4.0 dynamic builds correctly by inlining
          rb_check_typeddata (Yee Cheng Chin)

Ruby 4.0 broke Vim compilation in dynamic builds. That's because the
function `rb_check_typeddata` is now used in an inline function defined
in Ruby headers, which causes it to link against the lib statically
rather than using the one we load in dynamically
(`dll_rb_check_typeddata`) as we only remap it later (after the Ruby
header include).

A previous fix (v9.1.2036) did a wrong fix by stubbing in the actual
inline function `rbimpl_check_typeddata` instead. This does not work
because the inline function is not part of the dynamic lib and therefore
it's not possible to load it in dynamically (the patch also did not
actually attempt to load in the stub). With that patch, Vim would
crash when this function is used as the function pointer is null.

Fix this properly by reverting the previous change, and simply stub
`rb_check_typeddata` using similar mechanisms the file had already set
up for similar situations.

fixes:   #18884
related: #19051
closes:  #19060

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/if_ruby.c
src/version.c