1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-23 22:50:09 +03:00

M #-: Initialize var in parser

(cherry picked from commit b72b19a89f2a5ad83aa96ca7e2217a35f004c87e)
This commit is contained in:
Ruben S. Montero 2020-07-10 13:15:32 +02:00
parent d5d3dca441
commit d52265843d
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87
2 changed files with 2 additions and 2 deletions

View File

@ -1410,7 +1410,7 @@ yyreduce:
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;

View File

@ -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;}