vyper icon indicating copy to clipboard operation
vyper copied to clipboard

vyper.exceptions.CompilerPanic: unreachable AddrSpace

Open AntonD3 opened this issue 2 years ago • 1 comments

Version Information

  • vyper Version (output of vyper --version): 0.3.3
  • OS: macOS
  • Python Version (output of python --version): 2.7.16

What's your issue about?

vyper-0.3.3 error: vyper.exceptions.CompilerPanic: unreachable AddrSpace(name='calldata', word_scale=32, load_op='calldataload', store_op=None)

This is an unhandled internal compiler error. Please create an issue on Github to notify the developers.
https://github.com/vyperlang/vyper/issues/new?template=bug.md
[14346] Failed to execute script 'vyper_compile' due to unhandled exception!

interface Self:
    def split(p: uint256, nodes: Node[3]) -> (uint256, uint256): pure

struct Node:
    key: uint256
    l: uint256
    r: uint256

@external
@view
def split(p: uint256, nodes: Node[3]) -> (uint256, uint256):
    if p == 0:
        return (0, 0)
    if nodes[0].key < 1:
        p1: uint256 = 0
        p2: uint256 = 0
        (p1, p2) = Self(self).split(nodes[p].r, nodes)
        nodes[p].r = p1
        return (p, 0)
    else: # Should be unreachable(nodes[0].key == 0 always), but if remove this branch - test will work.
        p1: uint256 = 0
        p2: uint256 = 0
        (p1, p2) = Self(self).split(nodes[p].l, nodes)
        nodes[p].l = p2
        return (0, 0)

@external
@view
def f() -> Node[3]:
    nodes: Node[3] = empty(Node[3])
    nodes[1] = Node({key: 3, l: 0, r: 0})
    nodes[2] = Node({key: 2, l: 0, r: 1})

    Self(self).split(2, nodes)

    return nodes

AntonD3 avatar Aug 08 '22 16:08 AntonD3

result of the issue described in https://github.com/vyperlang/vyper/issues/2145, but the compiler should fail more gracefully

dup of https://github.com/vyperlang/vyper/issues/2609 but for external functions

charles-cooper avatar Aug 10 '22 16:08 charles-cooper

this seems to be fixed as of 046ea166d93b8351da7c5d74115893eea2f60d76 (and certainly as of 3c83947223e19a526e27bbeed69141021b82e060)

charles-cooper avatar May 08 '23 01:05 charles-cooper