diff graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/codewriter/AbstractCodeWriter.java @ 11200:380e0248f873

Truffle-DSL: Fixed a bug in the code writer when a line overflowed with an exact size of 200.
author Christian Humer <christian.humer@gmail.com>
date Mon, 05 Aug 2013 19:48:15 +0200
parents 58f09779319c
children 2b9fcffd6f36
line wrap: on
line diff
--- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/codewriter/AbstractCodeWriter.java	Mon Aug 05 19:46:51 2013 +0200
+++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/codewriter/AbstractCodeWriter.java	Mon Aug 05 19:48:15 2013 +0200
@@ -661,7 +661,13 @@
                 if (i != 0) {
                     write("+ ");
                 }
+
                 int nextSize = MAX_LINE_LENGTH - lineLength - 2;
+                if (nextSize <= 0) {
+                    writeLn();
+                    nextSize = MAX_LINE_LENGTH - lineLength - 2;
+                }
+
                 int end = Math.min(i + nextSize, string.length());
 
                 assert lineLength + (end - i) + 2 < MAX_LINE_LENGTH;