Skip to content

Fixes #620#863

Merged
ArquintL merged 2 commits intomasterfrom
issue-620
Feb 26, 2025
Merged

Fixes #620#863
ArquintL merged 2 commits intomasterfrom
issue-620

Conversation

@ArquintL
Copy link
Member

The issue seems related to old and labeled old expressions involving structs. In particular, we used the same addressability as old's argument. Thus, the encoding tried to handle the result of an old expression in the issue's example as a shared struct even though it is an exclusive struct.

000629-3.gobra tried to reproduce the same issue without using structs but this did not trigger the issue and this test case has been added just for completeness.

Fixes #620

@ArquintL ArquintL requested a review from jcp19 February 26, 2025 10:29
Copy link
Contributor

@jcp19 jcp19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines +566 to +568
case class Old(operand: Expr)(val info: Source.Parser.Info) extends Expr {
override def typ: Type = operand.typ.withAddressability(Addressability.rValue)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, interesting. I guess we never considered the case where we would pass a shared value. I guess this case never makes sense

@ArquintL ArquintL enabled auto-merge (squash) February 26, 2025 11:16
@ArquintL ArquintL merged commit d2bc4f8 into master Feb 26, 2025
3 checks passed
@ArquintL ArquintL deleted the issue-620 branch February 26, 2025 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Appending to a slice of a struct

2 participants