Remove initRegs arg from clone

It is always the same as t.initRegs.

PiperOrigin-RevId: 224085550
Change-Id: I5cc4ddc3b481d4748c3c43f6f4bb50da1dbac694
This commit is contained in:
Michael Pratt
2018-12-04 18:53:43 -08:00
committed by Shentubot
parent ffcbda0c8b
commit 076f107643
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -130,8 +130,8 @@ func (t *thread) getSignalInfo(si *arch.SignalInfo) error {
// call attach on it.
//
// Precondition: the OS thread must be locked and own t.
func (t *thread) clone(initRegs *syscall.PtraceRegs) (*thread, error) {
r, ok := usermem.Addr(initRegs.Rsp).RoundUp()
func (t *thread) clone() (*thread, error) {
r, ok := usermem.Addr(t.initRegs.Rsp).RoundUp()
if !ok {
return nil, syscall.EINVAL
}
@@ -153,7 +153,7 @@ func (t *thread) clone(initRegs *syscall.PtraceRegs) (*thread, error) {
arch.SyscallArgument{},
// We use these registers initially, but really they
// could be anything. We're going to stop immediately.
arch.SyscallArgument{Value: uintptr(unsafe.Pointer(initRegs))})
arch.SyscallArgument{Value: uintptr(unsafe.Pointer(&t.initRegs))})
if err != nil {
return nil, err
}
+1 -1
View File
@@ -160,7 +160,7 @@ func newSubprocess(create func() (*thread, error)) (*subprocess, error) {
// Wait for requests to create threads.
for r := range requests {
t, err := firstThread.clone(&firstThread.initRegs)
t, err := firstThread.clone()
if err != nil {
// Should not happen: not recoverable.
panic(fmt.Sprintf("error initializing first thread: %v", err))