From 65382473f7a1cf9bf3ea6ce74ecc5078735324b6 Mon Sep 17 00:00:00 2001 From: lethosor Date: Sat, 10 Jun 2017 17:22:52 -0400 Subject: [PATCH] Ruby: stop cpp_new from truncating vtable pointers This fixes a crash in levers.rb, for instance. --- plugins/ruby/ruby-autogen-defs.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ruby/ruby-autogen-defs.rb b/plugins/ruby/ruby-autogen-defs.rb index c1fb07ac1..c635efc2e 100644 --- a/plugins/ruby/ruby-autogen-defs.rb +++ b/plugins/ruby/ruby-autogen-defs.rb @@ -138,7 +138,7 @@ module DFHack def cpp_new(init=nil) ptr = DFHack.malloc(_sizeof) if _rtti_classname and vt = DFHack.rtti_getvtable(_rtti_classname) - DFHack.memory_write_int32(ptr, vt) + DFHack.memory_write_ptr(ptr, vt) # TODO call constructor end o = new._at(ptr)