Skip to content

Size mismatch when serializing error objects #10

@maximk

Description

@maximk

The following code:

    obj_p x = error(5, "myerror");
    obj_p fmt = obj_fmt(x, B8_TRUE);
    printf("%.*s", (uint32_t)fmt->len, as_string(fmt));
    drop_obj(fmt);

    int size = size_obj(x);

    u8_t buf[4096];
    int size1 = save_obj(buf, size, x);

    printf("size  = %d\n", size);
    printf("size1 = %d\n", size1);

produces this output:

•• [E005] error: type mismatch myerror
size  = 10
size1 = 15

Also, load_obj() moves the pointer not according to the size in the header.

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