Skip to content

add_virtual_method with parameter crashes engine when loading editor #1580

Closed
@hakuhan

Description

@hakuhan

Godot version

4.3

godot-cpp version

4.3

System information

Windows 11

Issue description

When I regist a method with a parameter to be virtual for godot. Editor crashed when launching.
I think it is caused by empty arguments_metadata in created MethodInfo.
I tried to add vector size checking code in class_db.cpp. And crash dosen't appear.
image

Steps to reproduce

  1. Regist a virtual method by calling:
    ClassDB::add_virtual_method("TestClass", MethodInfo(Variant::Type::BOOL, "func_with_parameter", PropertyInfo(Variant::STRING_NAME, "param_name", PROPERTY_HINT_NONE, "StringName", PROPERTY_USAGE_NONE)), {"param_name"});
  2. Build GDExtension.
  3. Launch game with VSCode or other IDEs.

Minimal reproduction project

Please try with steps thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions