summaryrefslogtreecommitdiff
path: root/lib/pile.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pile.c')
-rw-r--r--lib/pile.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/pile.c b/lib/pile.c
index 6298b92..1f98941 100644
--- a/lib/pile.c
+++ b/lib/pile.c
@@ -459,14 +459,18 @@ void act_pile(int func)
_
("act_pile: OP_FUNC_CALL need only one argument for a polynom evaluation"));
}
- if (operande[0].poly->degre == 0) {
- push_pile_poly(ply_constr
- (ply_valuation(operande2.poly, operande[0].poly->coef), 0));
- if (operande[0].poly)
+ if (operande[0].poly) {
+ if (operande[0].poly->degre == 0) {
+ push_pile_poly(ply_constr
+ (ply_valuation(operande2.poly, operande[0].poly->coef), 0));
ply_destruct(operande[0].poly);
- ply_destruct(operande2.poly);
+ ply_destruct(operande2.poly);
+ } else {
+ exception(1, _("act_pile: OP_FUNC_CALL incorrect value for 2nd arg"));
+ }
} else {
- exception(1, _("act_pile: OP_FUNC_CALL incorrect value for 2nd arg"));
+ push_pile_poly(ply_constr(ply_valuation(operande2.poly, rat_constr_zero()), 0));
+ ply_destruct(operande2.poly);
}
} else {
exception(1, _("act_pile: OP_FUNC_CALL arg2 is an empty polynom"));