]> Repositorios git - scryer-prolog.git/commitdiff
catch existence_error exceptions from top-level calls to attribute_goals/3 (#1432)
authorMark Thom <[email protected]>
Mon, 25 Apr 2022 02:59:00 +0000 (20:59 -0600)
committerMark Thom <[email protected]>
Mon, 25 Apr 2022 02:59:00 +0000 (20:59 -0600)
src/machine/machine_state_impl.rs
src/machine/project_attributes.pl

index cbd8d60258b81704257f4b9be2f778bcd8cfa4dc..5223dc92e32ea68131795e9b040b3c157dfe91fe 100644 (file)
@@ -1885,14 +1885,7 @@ impl MachineState {
                     }
                     (HeapCellValueTag::PStrLoc | HeapCellValueTag::PStrOffset, h) => {
                         let (focus, _) = pstr_loc_and_offset(&self.heap, h);
-                        let pstr_atom = read_heap_cell!(self.heap[focus],
-                            (HeapCellValueTag::CStr | HeapCellValueTag::PStr, pstr_atom) => {
-                                pstr_atom
-                            }
-                            _ => {
-                                unreachable!()
-                            }
-                        );
+                        let pstr_atom = cell_as_atom!(self.heap[focus]);
 
                         if has_tail {
                             self.s = HeapPtr::PStrLocation(focus, offset);
index ae2054e36b8da860dd0a2a30b3f30ea6111ed912..b2f750077820a4d451abfb9546aeab3a93a6567c 100644 (file)
@@ -32,6 +32,7 @@ call_attribute_goals([Module|Modules], GoalCaller, AttrVars) :-
 
 '$print_attribute_goals_exception'(Module, E) :-
     (  E = error(evaluation_error((Module:attribute_goals)/3), attribute_goals/3)
+    ;  E = error(existence_error(procedure, attribute_goals/3), attribute_goals/3)
     -> true
     ;  loader:write_error(E),
        nl