fix allocator bug.

This commit is contained in:
Mark Thom
2018-02-11 15:21:30 -07:00
parent 54e36f0d24
commit 47055d189d
4 changed files with 15 additions and 35 deletions

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)