diff options
author | Josh Suereth <Joshua.Suereth@gmail.com> | 2012-08-04 07:35:49 -0700 |
---|---|---|
committer | Josh Suereth <Joshua.Suereth@gmail.com> | 2012-08-04 07:35:49 -0700 |
commit | 2cee58f5a1f8f93b239b3086d6ab0c30729c6523 (patch) | |
tree | 9d22a4cf06295ce2d1f736acc9e6a31e024f7e48 /src/compiler | |
parent | 44e706df30069b463dc574a6ed39146a8d71634d (diff) | |
parent | d1a95c878908ce1a7a041151930f8637c0d7d891 (diff) | |
download | scala-2cee58f5a1f8f93b239b3086d6ab0c30729c6523.tar.gz scala-2cee58f5a1f8f93b239b3086d6ab0c30729c6523.tar.bz2 scala-2cee58f5a1f8f93b239b3086d6ab0c30729c6523.zip |
Merge pull request #1040 from hubertp/issue/asm-long-signatures-again
Fixes SI-6172.
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala | 8 |
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 } } |