From 227fd9f1b0a9123446907a662a5fe8e756cac16d Mon Sep 17 00:00:00 2001 From: Jamie Liu Date: Fri, 23 Oct 2020 12:51:29 -0700 Subject: //pkg/state fixes for VFS2. - When encodeState.resolve() determines that the resolved reflect.Value is contained by a previously-resolved object, set wire.Ref.Type to the containing object's type (existing.obj.Type()) rather than the contained value's type (obj.Type()). - When encodeState.resolve() determines that the resolved reflect.Value contains a previously-resolved object, handle cases where the new object contains *multiple* previously-resolved objects. (This may cause previously-allocated object IDs to become unused; to facilitate this, change encodeState.pending to a map, and change the wire format to prefix each object with its object ID.) - Add encodeState.encodedStructs to avoid redundant encoding of structs, since deduplication of objects via encodeState.resolve() doesn't work for objects instantiated by StateSave() and passed to SaveValue() (i.e. fields tagged `state:".(whatever)"`). - Make unexported array fields deserializable via slices that refer to them by casting away their unexportedness in decodeState.decodeObject(). Updates #1663 PiperOrigin-RevId: 338727687 --- tools/nogo/config.go | 1 + 1 file changed, 1 insertion(+) (limited to 'tools/nogo') diff --git a/tools/nogo/config.go b/tools/nogo/config.go index e70438f1d..91b36576f 100644 --- a/tools/nogo/config.go +++ b/tools/nogo/config.go @@ -116,6 +116,7 @@ var analyzerConfig = map[*analysis.Analyzer]matcher{ "pkg/sentry/platform/systrap/stub_unsafe.go", // Special case. "pkg/sentry/platform/systrap/switchto_google_unsafe.go", // Special case. "pkg/sentry/platform/systrap/sysmsg_thread_unsafe.go", // Special case. + "pkg/state/decode_unsafe.go", // Special case. ), ), unusedresult.Analyzer: alwaysMatches(), -- cgit v1.2.3