correct allocation bugs.

This commit is contained in:
Mark Thom
2018-02-11 12:03:13 -07:00
parent e7560150b0
commit 54e36f0d24
2 changed files with 3 additions and 3 deletions

View File

@@ -574,7 +574,7 @@ impl<'a, TermMarker: Allocator<'a>> CodeGenerator<'a, TermMarker>
let mut code = Vec::new();
if let &QueryTerm::Term(ref term) = p0 {
self.marker.reset_arg(term.arity());
self.marker.reset_arg_at_head(term);
self.compile_seq_prelude(&conjunct_info, &mut code);
if let &Term::Clause(..) = term {
@@ -586,7 +586,7 @@ impl<'a, TermMarker: Allocator<'a>> CodeGenerator<'a, TermMarker>
}
}
self.marker.reset_arg_at_head(term);
// self.marker.reset_arg_at_head(term);
let iter = ChunkedIterator::from_rule_body(p1, clauses);
try!(self.compile_seq(iter, &conjunct_info, &mut code, false));

View File

@@ -517,7 +517,7 @@ fn compile_decl<'a, 'b: 'a>(wam: &'a mut Machine, tl: &'b TopLevel, queue: &'b V
if let Err(e) = compile_appendix(&mut code, queue) {
return EvalSession::from(e);
};
if !code.is_empty() {
if let Some(name) = tl.name() {
wam.add_user_code(name, tl.arity(), code)