🐛 Fixed missing check for position 0
This commit is contained in:
parent
03cc8e17c6
commit
228d58655a
@ -22,7 +22,7 @@ impl<U: RegisterNum> Register<U> {
|
|||||||
|
|
||||||
/// Set value of register *position* to *value*
|
/// Set value of register *position* to *value*
|
||||||
pub fn set_reg(&mut self, position: usize, value: U) {
|
pub fn set_reg(&mut self, position: usize, value: U) {
|
||||||
self.register[position] = value;
|
if position != 0 { self.register[position] = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user