Skip to content
This repository was archived by the owner on Oct 20, 2024. It is now read-only.

Detect duplicate destination labels #295

@erhant

Description

@erhant

Huff (v0.3.2) allows one to place multiple destinations for the same label:

#define macro MAIN() = takes(0) returns(0) {
    label jump
    label: 0x00
    label: 0x00
}

It apparently chooses the position of the last one as the jump target, as seen by the runtime code (result of huffc -r) of the code above:

// 610006565b5f5b5f

/* 00 */ PUSH2 0x0006
/* 03 */ JUMP
/* 04 */ JUMPDEST
/* 05 */ PUSH0
/* 06 */ JUMPDEST
/* 07 */ PUSH0

Although an unlikely bug, it would do no harm to catch this bug at compile time.

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