Skip to content

compiler panic when using augassign with lhs and rhs overlap #4489

@cyberthirst

Description

@cyberthirst

#4487 blocks the bug described in GHSA-4w26-8p97-f4jp. however, we should fix the code generator so that it issues proper bounds checks.

example of such valid contract:

a: public(DynArray[uint256, 2])
interface Foo:
    def foo() -> uint256: view
@external
def foo() -> uint256:
    return self.a[1]
@external
def entry() -> DynArray[uint256, 2]:
    self.a = [1, 1]
    # panics due to staticcall
    self.a[1] += staticcall Foo(self).foo()
    return self.a

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug - type 0compiler halts or panics instead of generating code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions