fix partial_string_tail panic (#530)
This commit is contained in:
@@ -348,7 +348,9 @@ fn compile_into_module(
|
||||
);
|
||||
|
||||
match compile_into_module_impl(wam, &mut compiler, module, src, indices) {
|
||||
Ok(()) => EvalSession::EntrySuccess,
|
||||
Ok(()) => {
|
||||
EvalSession::EntrySuccess
|
||||
}
|
||||
Err(e) => {
|
||||
compiler.drop_expansions(&mut wam.code_repo);
|
||||
EvalSession::from(e)
|
||||
|
||||
@@ -1154,10 +1154,19 @@ impl MachineState {
|
||||
|
||||
match pstr {
|
||||
Addr::PStrLocation(h, _) => {
|
||||
let tail = self.heap[h + 1].as_addr(h + 1);
|
||||
let target = self[temp_v!(2)];
|
||||
if let HeapCellValue::PartialString(_, true) = &self.heap[h] {
|
||||
let tail = self.heap[h + 1].as_addr(h + 1);
|
||||
let target = self[temp_v!(2)];
|
||||
|
||||
self.unify(tail, target);
|
||||
self.unify(tail, target);
|
||||
} else {
|
||||
self.fail = true;
|
||||
return Ok(());
|
||||
}
|
||||
}
|
||||
Addr::EmptyList => {
|
||||
self.fail = true;
|
||||
return Ok(());
|
||||
}
|
||||
_ => {
|
||||
unreachable!()
|
||||
|
||||
Reference in New Issue
Block a user