Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Off by one bug in newv32? #21

@Pyrolistical

Description

@Pyrolistical

I found your repo in the Zig Discord while learning how to transfer strings from js to zig. Thanks for that btw. Your code really helped me.

While reading your code I think I might have found a bug?

wisp/web/wisp.js

Lines 105 to 106 in b12b8af

const buf = this.api.wisp_alloc(this.heap, 4 * arr.length)
const mem = new Uint32Array(this.api.memory.buffer, buf, arr.length)

In allocStrings +1 is added to the lengths in order to account for the sentinel value, but is missing in newv32.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions