Skip to content

Maximum string length changes depending on linked components #79

@alexcrichton

Description

@alexcrichton

Currently the canonical ABI defines a maximum string length where the upper bit can be reserved for a tag in the utf16+latin1 encoding, but the way this is currently specified to be enforced means that if a component tries to pass a string of length MAX_STRING_BYTE_LENGTH-1 that may work depending on the linked component. If a component using the utf-8 encoding of strings attempts to pass this string to a component using utf-16 encoding then the doubling of the string byte length will exceed MAX_STRING_BYTE_LENGTH which will cause a trap. If linked to a utf-8 component this would end up working (assuming the components can actually transfer gigabyte-scale strings which albeit is a bit out-there).

Should the maximum byte length for strings be further limited to ensure that no matter what component you're linked to the same maximum byte limit is always in effect?

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