mirror of
https://github.com/reactos/syzkaller.git
synced 2025-02-11 06:25:17 +00:00
prog: unexport Args and PyPhysicalAddr
This commit is contained in:
parent
32aa64c5ac
commit
4f4f70406c
@ -51,25 +51,6 @@ const (
|
||||
ExecNoCopyout = ^uint64(0)
|
||||
)
|
||||
|
||||
type Args []Arg
|
||||
|
||||
func (s Args) Len() int {
|
||||
return len(s)
|
||||
}
|
||||
|
||||
func (s Args) Swap(i, j int) {
|
||||
s[i], s[j] = s[j], s[i]
|
||||
}
|
||||
|
||||
type ByPhysicalAddr struct {
|
||||
Args
|
||||
Context *execContext
|
||||
}
|
||||
|
||||
func (s ByPhysicalAddr) Less(i, j int) bool {
|
||||
return s.Context.args[s.Args[i]].Addr < s.Context.args[s.Args[j]].Addr
|
||||
}
|
||||
|
||||
// SerializeForExec serializes program p for execution by process pid into the provided buffer.
|
||||
// Returns number of bytes written to the buffer.
|
||||
// If the provided buffer is too small for the program an error is returned.
|
||||
@ -137,7 +118,9 @@ func (p *Prog) SerializeForExec(buffer []byte) (int, error) {
|
||||
for arg := range csumMap {
|
||||
csumArgs = append(csumArgs, arg)
|
||||
}
|
||||
sort.Sort(ByPhysicalAddr{Args: csumArgs, Context: w})
|
||||
sort.Slice(csumArgs, func(i, j int) bool {
|
||||
return w.args[csumArgs[i]].Addr < w.args[csumArgs[j]].Addr
|
||||
})
|
||||
for i := len(csumArgs) - 1; i >= 0; i-- {
|
||||
arg := csumArgs[i]
|
||||
if _, ok := arg.Type().(*CsumType); !ok {
|
||||
|
Loading…
x
Reference in New Issue
Block a user