]> Repositorios git - scryer-prolog.git/commitdiff
break from loop in get_code upon successful character read
authorMark Thom <[email protected]>
Thu, 25 Nov 2021 06:13:14 +0000 (23:13 -0700)
committerMark Thom <[email protected]>
Fri, 7 Jan 2022 04:44:41 +0000 (21:44 -0700)
src/lib/builtins.pl
src/machine/system_calls.rs

index 41215a80bc1471b3446f82e381c97c301db6eb8e..86d5841f5185821ed88aff17ad214808e9dfe54e 100644 (file)
@@ -988,8 +988,10 @@ module_abolish(Pred, Module) :-
     ;  Pred = Name/Arity ->
        (  var(Name)  ->
           throw(error(instantiation_error, abolish/1))
+       ;  var(Arity) ->
+          throw(error(instantiation_error, abolish/1))
        ;  integer(Arity) ->
-          (  \+ atom(Name) ->
+          (\+ atom(Name) ->
              throw(error(type_error(atom, Name), abolish/1))
           ;  Arity < 0 ->
              throw(error(domain_error(not_less_than_zero, Arity), abolish/1))
@@ -1003,7 +1005,6 @@ module_abolish(Pred, Module) :-
              ;  throw(error(permission_error(modify, static_procedure, Pred), abolish/1))
              )
           )
-       ;  var(Arity) -> throw(error(instantiation_error, abolish/1))
        ;  throw(error(type_error(integer, Arity), abolish/1))
        )
     ;  throw(error(type_error(predicate_indicator, Module:Pred), abolish/1))
index eedb127b7800452c3d082cd1dea9d8b366b87246..a35a65e81e334dfe6af88bc6a0de903ae6c4eeb8 100644 (file)
@@ -2369,6 +2369,8 @@ impl MachineState {
                             if self.fail {
                                 return Ok(());
                             }
+
+                            break;
                         }
                         _ => {
                             self.eof_action(