make system calls exempt from call policy.
This commit is contained in:
@@ -232,14 +232,12 @@ impl<'a, TermMarker: Allocator<'a>> CodeGenerator<TermMarker>
|
||||
match ctrl.clone() {
|
||||
ControlInstruction::CallClause(ct, arity, pvs, false) =>
|
||||
*ctrl = ControlInstruction::CallClause(ct, arity, pvs, true),
|
||||
ControlInstruction::Goto(p, arity, false) =>
|
||||
*ctrl = ControlInstruction::Goto(p, arity, true),
|
||||
ControlInstruction::JmpBy(arity, offset, pvs, false) =>
|
||||
*ctrl = ControlInstruction::JmpBy(arity, offset, pvs, true),
|
||||
ControlInstruction::IsClause(false, r, at) =>
|
||||
*ctrl = ControlInstruction::IsClause(true, r, at),
|
||||
ControlInstruction::Proceed => {},
|
||||
_ => dealloc_index += 1 // = code.len()
|
||||
_ => dealloc_index += 1
|
||||
},
|
||||
Some(&mut Line::Cut(CutInstruction::Cut(_))) =>
|
||||
dealloc_index += 1,
|
||||
@@ -249,12 +247,12 @@ impl<'a, TermMarker: Allocator<'a>> CodeGenerator<TermMarker>
|
||||
dealloc_index
|
||||
}
|
||||
|
||||
fn compile_inlined(&mut self, ct: InlinedClauseType, terms: &'a Vec<Box<Term>>,
|
||||
fn compile_inlined(&mut self, ct: &InlinedClauseType, terms: &'a Vec<Box<Term>>,
|
||||
term_loc: GenContext, code: &mut Code)
|
||||
-> Result<(), ParserError>
|
||||
{
|
||||
match ct {
|
||||
InlinedClauseType::CompareNumber(cmp, ..) => {
|
||||
&InlinedClauseType::CompareNumber(cmp, ..) => {
|
||||
let (mut lcode, at_1) = self.call_arith_eval(terms[0].as_ref(), 1)?;
|
||||
let (mut rcode, at_2) = self.call_arith_eval(terms[1].as_ref(), 2)?;
|
||||
|
||||
@@ -265,7 +263,7 @@ impl<'a, TermMarker: Allocator<'a>> CodeGenerator<TermMarker>
|
||||
at_1.unwrap_or(interm!(1)),
|
||||
at_2.unwrap_or(interm!(2))));
|
||||
},
|
||||
InlinedClauseType::IsAtom(..) =>
|
||||
&InlinedClauseType::IsAtom(..) =>
|
||||
match terms[0].as_ref() {
|
||||
&Term::Constant(_, Constant::Atom(_)) => {
|
||||
code.push(succeed!());
|
||||
@@ -278,7 +276,7 @@ impl<'a, TermMarker: Allocator<'a>> CodeGenerator<TermMarker>
|
||||
code.push(fail!());
|
||||
}
|
||||
},
|
||||
InlinedClauseType::IsAtomic(..) =>
|
||||
&InlinedClauseType::IsAtomic(..) =>
|
||||
match terms[0].as_ref() {
|
||||
&Term::AnonVar | &Term::Clause(..) | &Term::Cons(..) => {
|
||||
code.push(fail!());
|
||||
@@ -291,7 +289,7 @@ impl<'a, TermMarker: Allocator<'a>> CodeGenerator<TermMarker>
|
||||
code.push(is_atomic!(r));
|
||||
}
|
||||
},
|
||||
InlinedClauseType::IsCompound(..) =>
|
||||
&InlinedClauseType::IsCompound(..) =>
|
||||
match terms[0].as_ref() {
|
||||
&Term::Clause(..) | &Term::Cons(..) => {
|
||||
code.push(succeed!());
|
||||
@@ -304,7 +302,7 @@ impl<'a, TermMarker: Allocator<'a>> CodeGenerator<TermMarker>
|
||||
code.push(fail!());
|
||||
}
|
||||
},
|
||||
InlinedClauseType::IsRational(..) =>
|
||||
&InlinedClauseType::IsRational(..) =>
|
||||
match terms[0].as_ref() {
|
||||
&Term::Constant(_, Constant::Number(Number::Rational(_))) => {
|
||||
code.push(succeed!());
|
||||
@@ -317,7 +315,7 @@ impl<'a, TermMarker: Allocator<'a>> CodeGenerator<TermMarker>
|
||||
code.push(fail!());
|
||||
}
|
||||
},
|
||||
InlinedClauseType::IsFloat(..) =>
|
||||
&InlinedClauseType::IsFloat(..) =>
|
||||
match terms[0].as_ref() {
|
||||
&Term::Constant(_, Constant::Number(Number::Float(_))) => {
|
||||
code.push(succeed!());
|
||||
@@ -330,7 +328,7 @@ impl<'a, TermMarker: Allocator<'a>> CodeGenerator<TermMarker>
|
||||
code.push(fail!());
|
||||
}
|
||||
},
|
||||
InlinedClauseType::IsString(..) =>
|
||||
&InlinedClauseType::IsString(..) =>
|
||||
match terms[0].as_ref() {
|
||||
&Term::Constant(_, Constant::String(_)) => {
|
||||
code.push(succeed!());
|
||||
@@ -343,7 +341,7 @@ impl<'a, TermMarker: Allocator<'a>> CodeGenerator<TermMarker>
|
||||
code.push(fail!());
|
||||
}
|
||||
},
|
||||
InlinedClauseType::IsNonVar(..) =>
|
||||
&InlinedClauseType::IsNonVar(..) =>
|
||||
match terms[0].as_ref() {
|
||||
&Term::AnonVar => {
|
||||
code.push(fail!());
|
||||
@@ -356,7 +354,7 @@ impl<'a, TermMarker: Allocator<'a>> CodeGenerator<TermMarker>
|
||||
code.push(succeed!());
|
||||
}
|
||||
},
|
||||
InlinedClauseType::IsInteger(..) =>
|
||||
&InlinedClauseType::IsInteger(..) =>
|
||||
match terms[0].as_ref() {
|
||||
&Term::Constant(_, Constant::Number(Number::Integer(_))) => {
|
||||
code.push(succeed!());
|
||||
@@ -369,7 +367,7 @@ impl<'a, TermMarker: Allocator<'a>> CodeGenerator<TermMarker>
|
||||
code.push(fail!());
|
||||
},
|
||||
},
|
||||
InlinedClauseType::IsVar(..) =>
|
||||
&InlinedClauseType::IsVar(..) =>
|
||||
match terms[0].as_ref() {
|
||||
&Term::Constant(..) | &Term::Clause(..) | &Term::Cons(..) => {
|
||||
code.push(fail!());
|
||||
@@ -446,7 +444,7 @@ impl<'a, TermMarker: Allocator<'a>> CodeGenerator<TermMarker>
|
||||
}
|
||||
}
|
||||
},
|
||||
&QueryTerm::Clause(_, ClauseType::Inlined(ct), ref terms) =>
|
||||
&QueryTerm::Clause(_, ClauseType::Inlined(ref ct), ref terms) =>
|
||||
try!(self.compile_inlined(ct, terms, term_loc, code)),
|
||||
_ => {
|
||||
let num_perm_vars = if chunk_num == 0 {
|
||||
|
||||
Reference in New Issue
Block a user