summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/kernel/pending_signals_list.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-03-03 22:13:29 +0000
committergVisor bot <gvisor-bot@google.com>2020-03-03 22:13:29 +0000
commit5f5127ba9ddb8f52d43827b6ab96b8169af5075f (patch)
tree701124de37c5bf475ba6920641948d637da0ee8b /pkg/sentry/kernel/pending_signals_list.go
parent56f91c540e938374a025c31cf23aa2e4d00cacec (diff)
parent844e4d284cddf9795a0db7c38f926fe7b49bb873 (diff)
Merge release-20200219.0-91-g844e4d2 (automated)
Diffstat (limited to 'pkg/sentry/kernel/pending_signals_list.go')
-rwxr-xr-xpkg/sentry/kernel/pending_signals_list.go33
1 files changed, 21 insertions, 12 deletions
diff --git a/pkg/sentry/kernel/pending_signals_list.go b/pkg/sentry/kernel/pending_signals_list.go
index a3499371a..26b9ffd98 100755
--- a/pkg/sentry/kernel/pending_signals_list.go
+++ b/pkg/sentry/kernel/pending_signals_list.go
@@ -54,8 +54,9 @@ func (l *pendingSignalList) Back() *pendingSignal {
// PushFront inserts the element e at the front of list l.
func (l *pendingSignalList) PushFront(e *pendingSignal) {
- pendingSignalElementMapper{}.linkerFor(e).SetNext(l.head)
- pendingSignalElementMapper{}.linkerFor(e).SetPrev(nil)
+ linker := pendingSignalElementMapper{}.linkerFor(e)
+ linker.SetNext(l.head)
+ linker.SetPrev(nil)
if l.head != nil {
pendingSignalElementMapper{}.linkerFor(l.head).SetPrev(e)
@@ -68,8 +69,9 @@ func (l *pendingSignalList) PushFront(e *pendingSignal) {
// PushBack inserts the element e at the back of list l.
func (l *pendingSignalList) PushBack(e *pendingSignal) {
- pendingSignalElementMapper{}.linkerFor(e).SetNext(nil)
- pendingSignalElementMapper{}.linkerFor(e).SetPrev(l.tail)
+ linker := pendingSignalElementMapper{}.linkerFor(e)
+ linker.SetNext(nil)
+ linker.SetPrev(l.tail)
if l.tail != nil {
pendingSignalElementMapper{}.linkerFor(l.tail).SetNext(e)
@@ -98,10 +100,14 @@ func (l *pendingSignalList) PushBackList(m *pendingSignalList) {
// InsertAfter inserts e after b.
func (l *pendingSignalList) InsertAfter(b, e *pendingSignal) {
- a := pendingSignalElementMapper{}.linkerFor(b).Next()
- pendingSignalElementMapper{}.linkerFor(e).SetNext(a)
- pendingSignalElementMapper{}.linkerFor(e).SetPrev(b)
- pendingSignalElementMapper{}.linkerFor(b).SetNext(e)
+ bLinker := pendingSignalElementMapper{}.linkerFor(b)
+ eLinker := pendingSignalElementMapper{}.linkerFor(e)
+
+ a := bLinker.Next()
+
+ eLinker.SetNext(a)
+ eLinker.SetPrev(b)
+ bLinker.SetNext(e)
if a != nil {
pendingSignalElementMapper{}.linkerFor(a).SetPrev(e)
@@ -112,10 +118,13 @@ func (l *pendingSignalList) InsertAfter(b, e *pendingSignal) {
// InsertBefore inserts e before a.
func (l *pendingSignalList) InsertBefore(a, e *pendingSignal) {
- b := pendingSignalElementMapper{}.linkerFor(a).Prev()
- pendingSignalElementMapper{}.linkerFor(e).SetNext(a)
- pendingSignalElementMapper{}.linkerFor(e).SetPrev(b)
- pendingSignalElementMapper{}.linkerFor(a).SetPrev(e)
+ aLinker := pendingSignalElementMapper{}.linkerFor(a)
+ eLinker := pendingSignalElementMapper{}.linkerFor(e)
+
+ b := aLinker.Prev()
+ eLinker.SetNext(a)
+ eLinker.SetPrev(b)
+ aLinker.SetPrev(e)
if b != nil {
pendingSignalElementMapper{}.linkerFor(b).SetNext(e)