Skip to content

Gobra does not immediately realize semantics of copying arrays by assignment #1027

Description

@felixlinker

In Go, assigning arrays copies them. Gobra fails to realize this immediately. I got the following to verify:

func f() {
	a1 /*@@@*/ := [1]int{0}
	// @ assert acc(&a1)
	a2 /*@@@*/ := a1
	// @ assert a1[0] == 0 // required for verification
	// @ assert &a1 != &a2
}

Removing assert a1[0] == 0 leads to a failure in verification of &a1 != &a2. This seems like unwanted behavior as the semantics of copying arrays and how that affects the respective addresses seem quite fundamental.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions