summaryrefslogtreecommitdiffhomepage
path: root/pkg/state/state.go
diff options
context:
space:
mode:
authorAdin Scannell <ascannell@google.com>2020-03-25 16:55:02 -0700
committerAdin Scannell <ascannell@google.com>2020-04-08 10:00:14 -0700
commit94b793262d3c54b4c32fed83d2bd121069680d15 (patch)
treec89f8101c0a39d419f21793afbd38e9eb8f64840 /pkg/state/state.go
parent71c7e24e5cb8641f4cb98b5fc848ae2033b29eac (diff)
Fix all copy locks violations.
This required minor restructuring of how system call tables were saved and restored, but it makes way more sense this way. Updates #2243
Diffstat (limited to 'pkg/state/state.go')
-rw-r--r--pkg/state/state.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/pkg/state/state.go b/pkg/state/state.go
index dbe507ab4..03ae2dbb0 100644
--- a/pkg/state/state.go
+++ b/pkg/state/state.go
@@ -241,10 +241,7 @@ func Register(name string, instance interface{}, fns Fns) {
//
// This function is used by the stateify tool.
func IsZeroValue(val interface{}) bool {
- if val == nil {
- return true
- }
- return reflect.DeepEqual(val, reflect.Zero(reflect.TypeOf(val)).Interface())
+ return val == nil || reflect.ValueOf(val).Elem().IsZero()
}
// step captures one encoding / decoding step. On each step, there is up to one