Skip to content

parsedict() in concore_base.hpp silently drops values when params contain a comma #610

Open

Description

@avinxshKD

parsedict() splits on , with std::getline. Works fine for {'a': 1, 'b': 2}. Breaks silently the moment any value has a comma in it like a list [1, 2].

// concore_base.hpp:57
while (std::getline(ss, token, ',')) {  // naive comma split, no nesting awareness

Input {'channels': [1, 2], 'gain': 0.5} channels gets truncated to [1, the 2] token has no : so it's silently dropped, and you get garbage.

Python side uses ast.literal_eval so it works correctly there. C++ silently returns wrong data. No error, no warning.

load_params() calls parsedict() and is hit on every Concore constructor. Anyone writing a C++ node with a non-trivial params dict gets silent data loss.

Fix is to rewrite parsedict() to track bracket/paren/quote depth before splitting on , . The infrastructure (parse_literal_value) already exists in concore_base.hpp parsedict just never got updated to use it.

Im working on the fix.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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