Skip to content

Ruby codegen can't handle vmethods that return std::string's #1209

@lethosor

Description

@lethosor

enabler::GetKeyDisplay() is new in DFHack/df-structures@559c23b#diff-cee8bfd3ccf90f6603c9dc081d54d943

This produces a vmethod unkret DFHack.vmethod_call(self, 0, InterfaceKey.int(arg0)) message in ruby/codegen.pl, and it looks like the generated function calls rb_dfget_rtti_classname, which can crash. The output below is from 64-bit OS X 0.44.03; note that the returned value for "2" is 0x101ee35c0, which is the address of enabler.

[DFHack]# rb puts df.enabler.GetKeyDisplay 2
4327355840
[DFHack]# rb puts df.enabler.GetKeyDisplay 3
(segfault)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions