*/
if (map->op == T_OP_CMP_FALSE) return 0;
+ /*
+ * Hoist this early, too.
+ */
+ if (map->op == T_OP_CMP_TRUE) {
+ MEM(n = fr_pair_afrom_da(ctx, tmpl_da(map->lhs)));
+ n->op = map->op;
+ fr_pair_append(out, n);
+ return 0;
+ }
+
/*
* List to list found, this is a special case because we don't need
* to allocate any attributes, just finding the current list, and change
talloc_free(n);
goto error;
}
- } else if (map->op != T_OP_CMP_TRUE) {
- if (fr_value_box_cast(n, &n->data, n->vp_type, n->da, tmpl_value(map->rhs)) < 0) {
- RPEDEBUG("Implicit cast failed");
- rcode = -1;
- talloc_free(n);
- goto error;
- }
+
+ } else if (fr_value_box_cast(n, &n->data, n->vp_type, n->da, tmpl_value(map->rhs)) < 0) {
+ RPEDEBUG("Implicit cast failed");
+ rcode = -1;
+ talloc_free(n);
+ goto error;
}
n->op = map->op;
fr_pair_append(out, n);