Skip to content

Commit

Permalink
core: print cfg line and column inside fix_rval() if resolve select f…
Browse files Browse the repository at this point in the history
…ails
  • Loading branch information
miconda committed Jan 21, 2017
1 parent 77bf247 commit d89d643
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/core/rvalue.c
Expand Up @@ -2839,7 +2839,7 @@ static int rve_can_optimize_str(struct rval_expr* rve)
return 0;
if (rve->op == RVE_RVAL_OP)
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);
if (rve->left.rve->op != RVE_RVAL_OP)
return 0;
Expand All @@ -2848,7 +2848,7 @@ static int rve_can_optimize_str(struct rval_expr* rve)
if (rve->right.rve){
if (rve->right.rve->op != RVE_RVAL_OP)
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))
return 0;
}
Expand All @@ -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);
switch(rv->type){
Expand All @@ -2876,8 +2876,13 @@ static int fix_rval(struct rvalue* rv)
return fix_actions(rv->v.action);
case RV_SEL:
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;
case RV_AVP:
Expand Down Expand Up @@ -3794,7 +3799,7 @@ int fix_rval_expr(void* p)
BUG("empty rval expr\n");
break;
case RVE_RVAL_OP:
ret = fix_rval(&rve->left.rval);
ret = fix_rval(&rve->left.rval, rve);
if (ret<0) goto error;
return ret;
case RVE_UMINUS_OP: /* unary operators */
Expand Down

0 comments on commit d89d643

Please sign in to comment.