|
@@ -2839,7 +2839,7 @@ static int rve_can_optimize_str(struct rval_expr* rve)
|
|
return 0;
|
|
return 0;
|
|
if (rve->op == RVE_RVAL_OP)
|
|
if (rve->op == RVE_RVAL_OP)
|
|
return 0;
|
|
return 0;
|
|
- LM_DBG("left %d, right %d\n",
|
|
|
|
|
|
+ LM_DBG("left %d, right %d\n",
|
|
rve->left.rve->op, rve->right.rve?rve->right.rve->op:0);
|
|
rve->left.rve->op, rve->right.rve?rve->right.rve->op:0);
|
|
if (rve->left.rve->op != RVE_RVAL_OP)
|
|
if (rve->left.rve->op != RVE_RVAL_OP)
|
|
return 0;
|
|
return 0;
|
|
@@ -2848,7 +2848,7 @@ static int rve_can_optimize_str(struct rval_expr* rve)
|
|
if (rve->right.rve){
|
|
if (rve->right.rve){
|
|
if (rve->right.rve->op != RVE_RVAL_OP)
|
|
if (rve->right.rve->op != RVE_RVAL_OP)
|
|
return 0;
|
|
return 0;
|
|
- if ((rve->right.rve->left.rval.type!=RV_STR) &&
|
|
|
|
|
|
+ if ((rve->right.rve->left.rval.type!=RV_STR) &&
|
|
(rve->right.rve->left.rval.type!=RV_INT))
|
|
(rve->right.rve->left.rval.type!=RV_INT))
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
@@ -2858,7 +2858,7 @@ static int rve_can_optimize_str(struct rval_expr* rve)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-static int fix_rval(struct rvalue* rv)
|
|
|
|
|
|
+static int fix_rval(struct rvalue* rv, struct rval_expr* rve)
|
|
{
|
|
{
|
|
LM_DBG("RV fixing type %d\n", rv->type);
|
|
LM_DBG("RV fixing type %d\n", rv->type);
|
|
switch(rv->type){
|
|
switch(rv->type){
|
|
@@ -2876,8 +2876,13 @@ static int fix_rval(struct rvalue* rv)
|
|
return fix_actions(rv->v.action);
|
|
return fix_actions(rv->v.action);
|
|
case RV_SEL:
|
|
case RV_SEL:
|
|
if (resolve_select(&rv->v.sel)<0){
|
|
if (resolve_select(&rv->v.sel)<0){
|
|
- ERR("Unable to resolve select\n");
|
|
|
|
- print_select(&rv->v.sel);
|
|
|
|
|
|
+ if(rve==NULL) {
|
|
|
|
+ ERR("Unable to resolve select\n");
|
|
|
|
+ } else {
|
|
|
|
+ ERR("Unable to resolve select in cfg at line: %d col: %d\n",
|
|
|
|
+ rve->fpos.s_line, rve->fpos.s_col);
|
|
|
|
+ }
|
|
|
|
+ err_select(&rv->v.sel);
|
|
}
|
|
}
|
|
return 0;
|
|
return 0;
|
|
case RV_AVP:
|
|
case RV_AVP:
|
|
@@ -3794,7 +3799,7 @@ int fix_rval_expr(void* p)
|
|
BUG("empty rval expr\n");
|
|
BUG("empty rval expr\n");
|
|
break;
|
|
break;
|
|
case RVE_RVAL_OP:
|
|
case RVE_RVAL_OP:
|
|
- ret = fix_rval(&rve->left.rval);
|
|
|
|
|
|
+ ret = fix_rval(&rve->left.rval, rve);
|
|
if (ret<0) goto error;
|
|
if (ret<0) goto error;
|
|
return ret;
|
|
return ret;
|
|
case RVE_UMINUS_OP: /* unary operators */
|
|
case RVE_UMINUS_OP: /* unary operators */
|