Skip to content

Text format: memarg doesn't follow lexical format #1552

Closed

Description

@tlively

The offset and align fields in memargs are specified as 'offset='o:u32 and 'align='a:u32 with no space between the keywords and the u32s. However, according to the longest match rule in the lexical format, valid offsets and alignments such as offset=0 and align=3 are reserved and should not appear in the source.

Obviously we can't fix this by changing the format of the offset and align fields due to backward compatibility. Is there a way we can safely fix this in the lexical format?

Activity

  1. rossberg commented on Oct 20, 2022

    @rossberg
    Member

    Yeah, the spec hand-waves about this by saying

    Lexically, an offset or align phrase is considered a single keyword token

    in the section on memory instructions. Of course, that contradicts the earlier claim that all keyword tokens are defined by literals in the grammar. I suppose the simplest fix is to widen that statement appropriately.

  2. tlively commented on Oct 21, 2022

    @tlively
    MemberAuthor

    Oh good, I hadn't seen that text. I'll make a PR adding more nuance to the definition of keyword tokens.

  3. added a commit that references this issue on Oct 21, 2022
    1722424
  4. added a commit that references this issue on Oct 28, 2022
    1831a38
  5. added a commit that references this issue on Mar 17, 2023
    9f861ea
  6. added a commit that references this issue on Jul 12, 2023
    887fff3
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