fix off by one bug in system_calls
@@ -354,7 +354,7 @@ pub fn detect_cycles_with_max(&self, max_steps: usize, value: HeapCellValue) ->
let cstr = PartialString::from(cstr_atom);
let pstr_chars = cstr.as_str_from(0).chars().count();
- if pstr_chars < max_steps {
+ if pstr_chars <= max_steps {
CycleSearchResult::ProperList(pstr_chars)
} else {
CycleSearchResult::UntouchedCStr(cstr_atom, max_steps)
@@ -734,7 +734,7 @@ pub fn value_to_str_like(&mut self, value: HeapCellValue) -> Option<AtomOrString
// avoid allocating a String if possible ...
Some(AtomOrString::Atom(cstr_atom))
}
- (HeapCellValueTag::Atom, (atom, arity)) => {
+ (HeapCellValueTag::Atom, (atom, arity)) => { // TODO: Char??
if arity == 0 {
// ... likewise.
Some(AtomOrString::Atom(atom))
@@ -4424,11 +4424,6 @@ pub(super) fn system_call(
&SystemClauseType::UnwindStack => {
self.unwind_stack();
}
- /*
- &SystemClauseType::Variant => {
- self.fail = self.structural_eq_test();
- }
- */
&SystemClauseType::WAMInstructions => {
let module_name = cell_as_atom!(self.store(self.deref(self.registers[1])));
