Skip to content

Commit

Permalink
add test for crossrealm new escaped internal objects
Browse files Browse the repository at this point in the history
  • Loading branch information
jaekwon committed Jul 7, 2024
1 parent 3a498f6 commit 60b99cc
Show file tree
Hide file tree
Showing 2 changed files with 683 additions and 6 deletions.
9 changes: 3 additions & 6 deletions gnovm/pkg/gnolang/realm.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,7 @@ func (rlm *Realm) processNewCreatedMarks(store Store) {
// NOTE: the following range does not work
// because incRefCreatedDescendants may append to newCreated
// for the case when new escapes are found to have crossed.
// XXX write test.
// for _, oo := range rlm.newCreated {
// BAD: for _, oo := range rlm.newCreated {
for i := 0; i < len(rlm.newCreated); i++ {
oo := rlm.newCreated[i]
if debug {
Expand Down Expand Up @@ -583,11 +582,9 @@ func (rlm *Realm) processNewEscapedMarks(store Store) {
// exists, mark dirty.
rlm.MarkDirty(po)
}
// TODO: move to if debug { } once proven.
if eo.GetObjectID().IsZero() {
// this can happen if a ref +1
// new object gets passed into
// an external realm function.
rlm.assignNewObjectID(eo)
panic("new escaped object has no object ID")

Check warning on line 587 in gnovm/pkg/gnolang/realm.go

View check run for this annotation

Codecov / codecov/patch

gnovm/pkg/gnolang/realm.go#L587

Added line #L587 was not covered by tests
}

// escaped has no owner.
Expand Down
Loading

0 comments on commit 60b99cc

Please sign in to comment.