aboutsummaryrefslogtreecommitdiff
path: root/src/encoding
diff options
context:
space:
mode:
Diffstat (limited to 'src/encoding')
-rw-r--r--src/encoding/json/decode.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/encoding/json/decode.go b/src/encoding/json/decode.go
index 1a05ef59a2..98102291ab 100644
--- a/src/encoding/json/decode.go
+++ b/src/encoding/json/decode.go
@@ -472,7 +472,7 @@ func indirect(v reflect.Value, decodingNull bool) (Unmarshaler, encoding.TextUnm
// Prevent infinite loop if v is an interface pointing to its own address:
// var v any
// v = &v
- if v.Elem().Kind() == reflect.Interface && v.Elem().Elem() == v {
+ if v.Elem().Kind() == reflect.Interface && v.Elem().Elem().Equal(v) {
v = v.Elem()
break
}