]> Repositorios git - scryer-prolog.git/commitdiff
fix skip_max_list crash on bigint max_steps (#2382)
authorMark Thom <[email protected]>
Wed, 10 Apr 2024 00:57:53 +0000 (18:57 -0600)
committerMark Thom <[email protected]>
Wed, 10 Apr 2024 00:57:53 +0000 (18:57 -0600)
src/machine/system_calls.rs

index 7a3210045c62b95457e6632b59db76e6f6c16ae9..1b7a509e5a8e8fdd15b263953177a26210982933 100644 (file)
@@ -747,11 +747,7 @@ impl MachineState {
 
             let max_steps_n = match max_steps {
                 Ok(Number::Fixnum(n)) => Some(n.get_num()),
-                Ok(Number::Integer(n)) => {
-                    let value: i64 = (&*n).try_into().unwrap();
-
-                    Some(value)
-                }
+                Ok(Number::Integer(n)) => (&*n).try_into().ok(),
                 _ => None,
             };