mirror of
https://github.com/reactos/syzkaller.git
synced 2024-11-24 11:59:58 +00:00
36d1c4540a
Fix typos, non-canonical code, remove dead code, etc.
31 lines
687 B
Go
31 lines
687 B
Go
// Copyright 2015 syzkaller project authors. All rights reserved.
|
|
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
|
|
|
|
// Package cover provides types for working with coverage information (arrays of covered PCs).
|
|
package cover
|
|
|
|
type Cover map[uint32]struct{}
|
|
|
|
func (cov *Cover) Merge(raw []uint32) {
|
|
c := *cov
|
|
if c == nil {
|
|
c = make(Cover)
|
|
*cov = c
|
|
}
|
|
for _, pc := range raw {
|
|
c[pc] = struct{}{}
|
|
}
|
|
}
|
|
|
|
func (cov Cover) Serialize() []uint32 {
|
|
res := make([]uint32, 0, len(cov))
|
|
for pc := range cov {
|
|
res = append(res, pc)
|
|
}
|
|
return res
|
|
}
|
|
|
|
func RestorePC(pc uint32, base uint32) uint64 {
|
|
return uint64(base)<<32 + uint64(pc)
|
|
}
|