Skip to content

Commit

Permalink
fix(gnolang#2035): Prevent infinite loops caused by cyclic references…
Browse files Browse the repository at this point in the history
… on typedValue
  • Loading branch information
omarsy committed May 4, 2024
1 parent 88b9aa3 commit 714ddad
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gnovm/pkg/gnolang/values_string.go
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,10 @@ func (tv TypedValue) ProtectedString(seen *seenValues) string {
}
} else {
vs = tv.ProtectedSprint(seen, false)

seen.Put(tv.V)
defer seen.Pop()

if base := baseOf(tv.T); base == StringType || base == UntypedStringType {
vs = strconv.Quote(vs)
}
Expand Down

0 comments on commit 714ddad

Please sign in to comment.