Skip to content

Commit 6bc012d

Browse files
authored
fix crash when unparsing large unary numbers (#787)
* fix crash when unparsing large unary numbers * remove useless `into()`
1 parent 918c3bc commit 6bc012d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/algorithm/monadic/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,8 @@ impl Value {
485485
if n < 0.0 || n.fract() != 0.0 {
486486
return Err(env.error(format!("Cannot unparse {n} to base {base}")));
487487
}
488-
Ok(iter::repeat_n('1', n as usize).collect::<String>().into())
488+
let _ = validate_size::<char>([n as usize], env)?;
489+
Ok(iter::repeat_n('1', n as usize).collect())
489490
}
490491
10 => Ok(n.to_string()),
491492
64 => {

0 commit comments

Comments
 (0)