changeset 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 86af3ced0fce
children 7fc3e1fb3965
files graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/codewriter/AbstractCodeWriter.java
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
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;