Skip to content

Commit

Permalink
Validate addresses after insertion
Browse files Browse the repository at this point in the history
  • Loading branch information
fmoletta committed Aug 1, 2023
1 parent 8d3b42b commit 46b5c26
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/vm/memory/memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ func (m *Memory) Insert(addr Relocatable, val *MaybeRelocatable) error {
}

m.data[addr] = *val

return nil
return m.validateAddress(addr)
}

// Gets some value stored in the memory address `addr`.
Expand All @@ -77,6 +76,7 @@ func (m *Memory) Get(addr Relocatable) (*MaybeRelocatable, error) {
return &value, nil
}

// Adds a validation rule for a given segment
func (m *Memory) AddValidationRule(segment_index uint, rule ValidationRule) {
m.validation_rules[segment_index] = rule
}
Expand Down

0 comments on commit 46b5c26

Please sign in to comment.