We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6189316 commit 7ff0e29Copy full SHA for 7ff0e29
third_party/move/move-bytecode-verifier/src/reference_safety/abstract_state.rs
@@ -466,6 +466,16 @@ impl AbstractState {
466
mut_: bool,
467
) -> PartialVMResult<AbstractValue> {
468
let vec_id = safe_unwrap!(vector.ref_id());
469
+
470
+ // For immutable borrow, check that the vector is readable
471
+ if !mut_ && !self.is_readable(vec_id, None) {
472
+ return Err(self.error(
473
+ StatusCode::VEC_BORROW_ELEMENT_EXISTS_MUTABLE_BORROW_ERROR,
474
+ offset,
475
+ ));
476
+ }
477
478
+ // For mutable borrow, check that the vector is writable
479
if mut_ && !self.is_writable(vec_id) {
480
return Err(self.error(
481
StatusCode::VEC_BORROW_ELEMENT_EXISTS_MUTABLE_BORROW_ERROR,
0 commit comments