summaryrefslogtreecommitdiffhomepage
path: root/pkg/state
diff options
context:
space:
mode:
authorZhaozhong Ni <nzz@google.com>2018-12-04 13:13:13 -0800
committerShentubot <shentubot@google.com>2018-12-04 13:14:24 -0800
commitad8f293e1af99f3c04d1020bb51b46c0dba60e45 (patch)
tree7272b7ef2f7f083c60b93879e329b402fb24388a /pkg/state
parent54dd0d0dc5ee452890628c537e6ebd1ac8c9d699 (diff)
sentry: save copy of tcp segment's delivered views to avoid in-struct pointers.
PiperOrigin-RevId: 224033238 Change-Id: Ie5b1854b29340843b02c123766d290a8738d7631
Diffstat (limited to 'pkg/state')
-rw-r--r--pkg/state/encode.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/pkg/state/encode.go b/pkg/state/encode.go
index 577aaf051..fe8512bbf 100644
--- a/pkg/state/encode.go
+++ b/pkg/state/encode.go
@@ -119,9 +119,10 @@ func (es *encodeState) register(obj reflect.Value) uint64 {
if size := typ.Size(); size > 0 {
r := addrRange{addr, addr + size}
if !es.values.IsEmptyRange(r) {
- panic(fmt.Errorf("overlapping objects: [new object] %#v [existing object] %#v", obj.Interface(), es.values.FindSegment(addr).Value().Elem().Interface()))
+ old := es.values.LowerBoundSegment(addr).Value().Interface().(recoverable)
+ panic(fmt.Errorf("overlapping objects: [new object] %#v [existing object path] %s", obj.Interface(), old.path()))
}
- es.values.Add(r, obj)
+ es.values.Add(r, reflect.ValueOf(es.recoverable.copy()))
}
} else {
// Push back the map itself; when maps are encoded from the