Skip to content

Commit

Permalink
M #-: Initialize var in parser
Browse files Browse the repository at this point in the history
  • Loading branch information
rsmontero committed Jul 10, 2020
1 parent d1aa944 commit b72b19a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/parsers/expr_arith.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1410,7 +1410,7 @@ YYLTYPE yylloc = yyloc_default;

case 4:
#line 103 "expr_arith.y"
{ float val; oxml->search((yyvsp[0].val_str), val); (yyval.val_float) = val; }
{ float val = 0; oxml->search((yyvsp[0].val_str), val); (yyval.val_float) = val; }
#line 1415 "expr_arith.cc"
break;

Expand Down
2 changes: 1 addition & 1 deletion src/parsers/expr_arith.y
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ stmt: expr { result = static_cast<int>($1);}
| { result = 0; }
;

expr: STRING { float val; oxml->search($1, val); $$ = val; }
expr: STRING { float val = 0; oxml->search($1, val); $$ = val; }
| FLOAT { $$ = $1; }
| INTEGER { $$ = static_cast<float>($1); }
| expr '+' expr { $$ = $1 + $3;}
Expand Down

0 comments on commit b72b19a

Please sign in to comment.