Merge pull request #1630 from epilys/fix-1625
fix type_error with instantiated EOF -1 byte literal in get_byte/2
This commit is contained in:
@@ -2432,6 +2432,12 @@ impl Machine {
|
||||
addr
|
||||
} else {
|
||||
match Number::try_from(addr) {
|
||||
Ok(Number::Integer(ref n)) if **n == -1_i64 => {
|
||||
fixnum_as_cell!(Fixnum::build_with(-1))
|
||||
}
|
||||
Ok(Number::Fixnum(n)) if n.get_num() == -1_i64 => {
|
||||
fixnum_as_cell!(Fixnum::build_with(-1))
|
||||
}
|
||||
Ok(Number::Integer(n)) => {
|
||||
if let Some(nb) = n.to_u8() {
|
||||
fixnum_as_cell!(Fixnum::build_with(nb as i64))
|
||||
|
||||
Reference in New Issue
Block a user