Bug 657389 - nsHtml5MetaScanner should use PR_INT32_MAX instead of -1 as a special marker value for indeces. r=jonas.
authorHenri Sivonen <hsivonen@iki.fi>
Wed, 07 Sep 2011 12:50:15 +0300
changeset 76642 73f8f5071c8bb371d697fdd68083e911432873a4
parent 76641 8a9c10ebbf00795f005b3612fe472f5bd2bf3382
child 76643 c7e4e6e380ba0eaab6a610a77a89dd8dc23783d2
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersjonas
bugs657389
milestone9.0a1
Bug 657389 - nsHtml5MetaScanner should use PR_INT32_MAX instead of -1 as a special marker value for indeces. r=jonas.
parser/html/javasrc/MetaScanner.java
parser/html/nsHtml5MetaScanner.cpp
--- a/parser/html/javasrc/MetaScanner.java
+++ b/parser/html/javasrc/MetaScanner.java
@@ -573,18 +573,18 @@ public abstract class MetaScanner {
                                 continue stateloop;
                             case 'c':
                             case 'C':
                                 contentIndex = 0;
                                 charsetIndex = 0;
                                 state = MetaScanner.ATTRIBUTE_NAME;
                                 continue stateloop;
                             default:
-                                contentIndex = -1;
-                                charsetIndex = -1;
+                                contentIndex = Integer.MAX_VALUE;
+                                charsetIndex = Integer.MAX_VALUE;
                                 state = MetaScanner.ATTRIBUTE_NAME;
                                 continue stateloop;
                         }
                     }
                     // XXX reorder point
                 case MARKUP_DECLARATION_OPEN:
                     markupdeclarationopenloop: for (;;) {
                         c = read();
--- a/parser/html/nsHtml5MetaScanner.cpp
+++ b/parser/html/nsHtml5MetaScanner.cpp
@@ -519,18 +519,18 @@ nsHtml5MetaScanner::stateLoop(PRInt32 st
             case 'c':
             case 'C': {
               contentIndex = 0;
               charsetIndex = 0;
               state = NS_HTML5META_SCANNER_ATTRIBUTE_NAME;
               NS_HTML5_CONTINUE(stateloop);
             }
             default: {
-              contentIndex = -1;
-              charsetIndex = -1;
+              contentIndex = PR_INT32_MAX;
+              charsetIndex = PR_INT32_MAX;
               state = NS_HTML5META_SCANNER_ATTRIBUTE_NAME;
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
       }
       case NS_HTML5META_SCANNER_MARKUP_DECLARATION_OPEN: {
         for (; ; ) {