recognize [] as equivalent to "" in unify_atom (#1288)
This commit is contained in:
@@ -544,6 +544,9 @@ impl MachineState {
|
||||
(HeapCellValueTag::Atom, (name, arity)) => {
|
||||
self.fail = !(arity == 0 && name == atom);
|
||||
}
|
||||
(HeapCellValueTag::CStr, cstr_atom) if atom == atom!("[]") => {
|
||||
self.fail = cstr_atom != atom!("");
|
||||
}
|
||||
(HeapCellValueTag::Char, c1) => {
|
||||
if let Some(c2) = atom.as_char() {
|
||||
self.fail = c1 != c2;
|
||||
|
||||
@@ -2494,9 +2494,10 @@ impl Machine {
|
||||
}
|
||||
};
|
||||
|
||||
let output = self.machine_st.store(self.machine_st.deref(self.machine_st.registers[3]));
|
||||
let atom = self.machine_st.atom_tbl.build_with(&string);
|
||||
self.machine_st.unify_complete_string(atom, self.machine_st.store(self.machine_st.deref(self.machine_st.registers[3])));
|
||||
|
||||
self.machine_st.unify_complete_string(atom, output);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user