Browse Source

[4125] Fixed variable init (BTW a false positive as ctx.error throws)

Francis Dupont 9 years ago
parent
commit
2c39600ea5
2 changed files with 2 additions and 2 deletions
  1. 1 1
      src/lib/eval/parser.cc
  2. 1 1
      src/lib/eval/parser.yy

+ 1 - 1
src/lib/eval/parser.cc

@@ -595,7 +595,7 @@ namespace isc { namespace eval {
   case 6:
 #line 90 "parser.yy" // lalr1.cc:859
     {
-                      int n;
+                      int n = 0;
                       try {
                           n  = boost::lexical_cast<int>(yystack_[1].value.as< std::string > ());
                       } catch (const boost::bad_lexical_cast &) {

+ 1 - 1
src/lib/eval/parser.yy

@@ -88,7 +88,7 @@ string_expr : STRING
                   }
             | OPTION "[" INTEGER "]"
                   {
-                      int n;
+                      int n = 0;
                       try {
                           n  = boost::lexical_cast<int>($3);
                       } catch (const boost::bad_lexical_cast &) {