]> Repositorios git - scryer-prolog.git/commitdiff
Fix bitwise shift functions type error in the second argument
authorPaulo Moura <>
Sun, 9 May 2021 18:58:35 +0000 (19:58 +0100)
committerPaulo Moura <>
Sun, 9 May 2021 18:58:35 +0000 (19:58 +0100)
src/machine/arithmetic_ops.rs

index dc06fd5a901ae7f4782de30dec8a884050621e7b..4e3f832af794771e89736ebe027a0182940211e3 100644 (file)
@@ -676,6 +676,10 @@ impl MachineState {
                 MachineError::type_error(self.heap.h(), ValidType::Integer, n2),
                 stub,
             )),
+            (Number::Fixnum(_), n2) => Err(self.error_form(
+                MachineError::type_error(self.heap.h(), ValidType::Integer, n2),
+                stub,
+            )),
             (n1, _) => Err(self.error_form(
                 MachineError::type_error(self.heap.h(), ValidType::Integer, n1),
                 stub,
@@ -716,6 +720,10 @@ impl MachineState {
                 MachineError::type_error(self.heap.h(), ValidType::Integer, n2),
                 stub,
             )),
+            (Number::Fixnum(_), n2) => Err(self.error_form(
+                MachineError::type_error(self.heap.h(), ValidType::Integer, n2),
+                stub,
+            )),
             (n1, _) => Err(self.error_form(
                 MachineError::type_error(self.heap.h(), ValidType::Integer, n1),
                 stub,