catch existence_error exceptions from top-level calls to attribute_goals/3 (#1432)
This commit is contained in:
@@ -1885,14 +1885,7 @@ impl MachineState {
|
|||||||
}
|
}
|
||||||
(HeapCellValueTag::PStrLoc | HeapCellValueTag::PStrOffset, h) => {
|
(HeapCellValueTag::PStrLoc | HeapCellValueTag::PStrOffset, h) => {
|
||||||
let (focus, _) = pstr_loc_and_offset(&self.heap, h);
|
let (focus, _) = pstr_loc_and_offset(&self.heap, h);
|
||||||
let pstr_atom = read_heap_cell!(self.heap[focus],
|
let pstr_atom = cell_as_atom!(self.heap[focus]);
|
||||||
(HeapCellValueTag::CStr | HeapCellValueTag::PStr, pstr_atom) => {
|
|
||||||
pstr_atom
|
|
||||||
}
|
|
||||||
_ => {
|
|
||||||
unreachable!()
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
if has_tail {
|
if has_tail {
|
||||||
self.s = HeapPtr::PStrLocation(focus, offset);
|
self.s = HeapPtr::PStrLocation(focus, offset);
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ call_attribute_goals([Module|Modules], GoalCaller, AttrVars) :-
|
|||||||
|
|
||||||
'$print_attribute_goals_exception'(Module, E) :-
|
'$print_attribute_goals_exception'(Module, E) :-
|
||||||
( E = error(evaluation_error((Module:attribute_goals)/3), attribute_goals/3)
|
( E = error(evaluation_error((Module:attribute_goals)/3), attribute_goals/3)
|
||||||
|
; E = error(existence_error(procedure, attribute_goals/3), attribute_goals/3)
|
||||||
-> true
|
-> true
|
||||||
; loader:write_error(E),
|
; loader:write_error(E),
|
||||||
nl
|
nl
|
||||||
|
|||||||
Reference in New Issue
Block a user