Fix range overflow panics.

This commit is contained in:
Stephen Chung
2021-03-04 23:47:52 +08:00
parent 8d487906cc
commit 01664ef7ee
7 changed files with 241 additions and 56 deletions

View File

@@ -153,13 +153,13 @@ impl fmt::Display for EvalAltResult {
#[cfg(not(feature = "no_function"))]
Self::ErrorInFunctionCall(s, src, err, _) if crate::engine::is_anonymous_fn(s) => {
write!(f, "{}, in call to closure", err)?;
write!(f, "{} in call to closure", err)?;
if !src.is_empty() {
write!(f, " @ '{}'", src)?;
}
}
Self::ErrorInFunctionCall(s, src, err, _) => {
write!(f, "{}, in call to function {}", err, s)?;
write!(f, "{} in call to function {}", err, s)?;
if !src.is_empty() {
write!(f, " @ '{}'", src)?;
}