jdk/src/share/native/sun/font/layout/StateTableProcessor.cpp
changeset 16890 36b30720a997
parent 5506 202f599c92aa
child 16891 91e99bed64ae
--- a/jdk/src/share/native/sun/font/layout/StateTableProcessor.cpp	Fri Feb 15 13:07:17 2013 -0800
+++ b/jdk/src/share/native/sun/font/layout/StateTableProcessor.cpp	Tue Feb 26 10:07:26 2013 -0800
@@ -65,6 +65,9 @@
 
 void StateTableProcessor::process(LEGlyphStorage &glyphStorage)
 {
+
+    LE_STATE_PATIENCE_INIT();
+
     // Start at state 0
     // XXX: How do we know when to start at state 1?
     ByteOffset currentState = stateArrayOffset;
@@ -76,6 +79,7 @@
     beginStateTable();
 
     while (currGlyph <= glyphCount) {
+        if(LE_STATE_PATIENCE_DECR()) break; // patience exceeded.
         ClassCode classCode = classCodeOOB;
         if (currGlyph == glyphCount) {
             // XXX: How do we handle EOT vs. EOL?
@@ -92,8 +96,9 @@
 
         const EntryTableIndex *stateArray = (const EntryTableIndex *) ((char *) &stateTableHeader->stHeader + currentState);
         EntryTableIndex entryTableIndex = stateArray[(le_uint8)classCode];
-
+        LE_STATE_PATIENCE_CURR(le_int32, currGlyph);
         currentState = processStateEntry(glyphStorage, currGlyph, entryTableIndex);
+        LE_STATE_PATIENCE_INCR(currGlyph);
     }
 
     endStateTable();