Skip to content

Commit

Permalink
Update reference tracking to match stable-cadence
Browse files Browse the repository at this point in the history
  • Loading branch information
SupunS committed Dec 6, 2023
1 parent 2f7b982 commit 4685136
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions runtime/interpreter/value.go
Original file line number Diff line number Diff line change
Expand Up @@ -20487,6 +20487,21 @@ func (v *EphemeralReferenceValue) ForEach(
)
}

func (v *EphemeralReferenceValue) checkValidity(
interpreter *Interpreter,
locationRange LocationRange,
) Value {
referencedValue := v.ReferencedValue(interpreter, locationRange, true)
if referencedValue == nil {
panic(DereferenceError{
Cause: "the value being referenced has been destroyed or moved",
LocationRange: locationRange,
})
}

return *referencedValue
}

// AddressValue
type AddressValue common.Address

Expand Down

0 comments on commit 4685136

Please sign in to comment.