}
}
+/**
+ * returns wether the cmp evaluates to true or false, or can't be evaluated!
+ * 1: true, 0: false, -1: can't evaluate
+ */
static int eval_cmp(pn_Cmp pnc, tarval *tv1, tarval *tv2) {
pn_Cmp cmp_result = tarval_cmp(tv1, tv2);
// does the compare evaluate to true?
if(cmp_result == pn_Cmp_False)
- return 0;
+ return -1;
if((cmp_result & pnc) != cmp_result)
return 0;
tarval *tv_const = get_Const_tarval(env->cnst);
tarval *tv = get_Const_tarval(value);
- if(!eval_cmp(env->pnc, tv, tv_const)) {
+ if(eval_cmp(env->pnc, tv, tv_const) <= 0) {
return NULL;
}
tarval *tv_right = get_Const_tarval(right);
selector_evaluated = eval_cmp(pnc, tv_left, tv_right);
+ if(selector_evaluated < 0)
+ return;
}
}
} else if(is_Const(selector)) {