Skip to content

Commit

Permalink
Allow the length primop to be used for vectors
Browse files Browse the repository at this point in the history
(e.g., in the RISC-V model's current init_TLB)
  • Loading branch information
bacam committed Oct 2, 2024
1 parent 43bd80e commit 5117d17
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions isla-lib/src/primop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,7 @@ fn length<B: BV>(x: Val<B>, solver: &mut Solver<B>, info: SourceLoc) -> Result<V
Val::MixedBits(segments) => Ok(Val::I128(
segments.iter().try_fold(0, |n, segment| Ok(n + i128::from(segment_length(segment, solver, info)?)))?,
)),
Val::Vector(v) => Ok(Val::I128(v.len() as i128)),
_ => Err(ExecError::Type(format!("length {:?}", &x), info)),
}
}
Expand Down

0 comments on commit 5117d17

Please sign in to comment.