Skip to content

emit_yaml raises id < t.size() exception after using remove_child #356

@giubacc

Description

@giubacc

Hi, I've stumbled into an issue using rapidyaml version 0.5.0: the following code raises the following error on the emit_yaml statement:
check failed: id < t.size()

IMO, this should not happen, but I could have misunderstood how to use the library.

int main(int argc, char *argv[])
{
    ryml::csubstr yaml = R"(
numbers:
  one: true
  two: false
  three: false
  four: false
formats:
  rtt: json
)";

    ryml::Tree tree = ryml::parse_in_arena(yaml);
    ryml::NodeRef root = tree.rootref();
    ryml::NodeRef numbers = root["numbers"];
    numbers.remove_child("one");
    numbers.remove_child("two");
    numbers.remove_child("three");
    ryml::NodeRef formats = root["formats"];

    ryml::csubstr test = ryml::emit_yaml(tree, formats.id(), ryml::substr{}, false);
}

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions