mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Remove initRegs arg from clone
It is always the same as t.initRegs. PiperOrigin-RevId: 224085550 Change-Id: I5cc4ddc3b481d4748c3c43f6f4bb50da1dbac694
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user