Skip to content

Commit

Permalink
fix: incorrect index
Browse files Browse the repository at this point in the history
  • Loading branch information
welkin22 committed Nov 12, 2024
1 parent 483a318 commit 2fc801e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions core/types/mvstates.go
Original file line number Diff line number Diff line change
Expand Up @@ -537,29 +537,29 @@ func (s *MVStates) finalisePreviousRWSet(reads []RWEventItem, writes []RWEventIt

for _, item := range writes {
if item.Event == WriteAccRWEvent {
s.finaliseAccWrite(item.Index, item.Addr, item.State)
s.finaliseAccWrite(index, item.Addr, item.State)
} else if item.Event == WriteSlotRWEvent {
s.finaliseSlotWrite(item.Index, item.Addr, item.Slot)
s.finaliseSlotWrite(index, item.Addr, item.Slot)
}
}

for _, item := range reads {
if item.Event == ReadAccRWEvent {
accWrites := s.queryAccWrites(item.Addr, item.State)
if accWrites != nil {
if _, ok := accWrites.SearchTxIndex(item.Index); ok {
if _, ok := accWrites.SearchTxIndex(index); ok {
continue
}
}
s.finaliseAccRead(item.Index, item.Addr, item.State)
s.finaliseAccRead(index, item.Addr, item.State)
} else if item.Event == ReadSlotRWEvent {
slotWrites := s.querySlotWrites(item.Addr, item.Slot)
if slotWrites != nil {
if _, ok := slotWrites.SearchTxIndex(item.Index); ok {
if _, ok := slotWrites.SearchTxIndex(index); ok {
continue
}
}
s.finaliseSlotRead(item.Index, item.Addr, item.Slot)
s.finaliseSlotRead(index, item.Addr, item.Slot)
}
}

Expand Down

0 comments on commit 2fc801e

Please sign in to comment.