summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala
index f681de93b6..a804cc92d3 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala
@@ -932,7 +932,6 @@ abstract class GenASM extends SubComponent with BytecodeWriters {
ca
}
- // TODO this method isn't exercised during bootstrapping. Open question: is it bug free?
private def arrEncode(sb: ScalaSigBytes): Array[String] = {
var strs: List[String] = Nil
val bSeven: Array[Byte] = sb.sevenBitsMayBeZero
@@ -941,14 +940,15 @@ abstract class GenASM extends SubComponent with BytecodeWriters {
var offset = 0
var encLength = 0
while(offset < bSeven.size) {
- val newEncLength = encLength.toLong + (if(bSeven(offset) == 0) 2 else 1)
- if(newEncLength > 65535) {
+ val deltaEncLength = (if(bSeven(offset) == 0) 2 else 1)
+ val newEncLength = encLength.toLong + deltaEncLength
+ if(newEncLength >= 65535) {
val ba = bSeven.slice(prevOffset, offset)
strs ::= new java.lang.String(ubytesToCharArray(ba))
encLength = 0
prevOffset = offset
} else {
- encLength += 1
+ encLength += deltaEncLength
offset += 1
}
}