Skip to content

symbolics_11.py and symbolics_14.py produce invalid code #2469

Closed
@certik

Description

@certik

How to reproduce:

$ lpython symbolics_14.py --show-c
[...]
// Implementations
void mmrv(void* x, struct list_CPtr *_lpython_return_variable)
{
    struct list_CPtr l1;
    struct list_CPtr constname0;
    list_init_CPtr(&constname0, 1);
    constname0.data[0] = x;
    constname0.current_end_point = 1;
    list_deepcopy_CPtr(&constname0, &l1);

    list_deepcopy_CPtr(&l1, _lpython_return_variable);

}

The line constname0.data[0] = x; is incorrect, instead it should be basic_assign(constname0.data[0], x);.

The current code thus contains dangling points, so it might or might not segfault.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsymbolic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions