diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-04-21 14:42:52 -0700 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-04-21 14:42:52 -0700 |
commit | 2e0cef0e294e873f7cf441879c4d6294de620083 (patch) | |
tree | 9bc692cac5574076e198d6f4b7b1f13556cd5661 /src | |
parent | 1976172946ae646dbf007bd4bbf7839a12483318 (diff) | |
parent | 5cc2eb872432f5a00dd530f6a1e3f965c749162a (diff) | |
download | scala-2e0cef0e294e873f7cf441879c4d6294de620083.tar.gz scala-2e0cef0e294e873f7cf441879c4d6294de620083.tar.bz2 scala-2e0cef0e294e873f7cf441879c4d6294de620083.zip |
Merge pull request #2426 from paulp/pr/7324
SI-7324 jvm not cool with 255+ parameters
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala | 9 | ||||
-rw-r--r-- | src/reflect/scala/reflect/internal/ClassfileConstants.scala | 1 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala index 66a58870cc..1b183ddd3f 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala @@ -25,6 +25,10 @@ abstract class GenASM extends SubComponent with BytecodeWriters with GenJVMASM { import icodes.opcodes._ import definitions._ + // Strangely I can't find this in the asm code + // 255, but reserving 1 for "this" + final val MaximumJvmParameters = 254 + val phaseName = "jvm" /** Create a new phase */ @@ -1480,6 +1484,11 @@ abstract class GenASM extends SubComponent with BytecodeWriters with GenJVMASM { if (m.symbol.isStaticConstructor || definitions.isGetClass(m.symbol)) return + if (m.params.size > MaximumJvmParameters) { + getCurrentCUnit().error(m.symbol.pos, s"Platform restriction: a parameter list's length cannot exceed $MaximumJvmParameters.") + return + } + debuglog("Generating method " + m.symbol.fullName) method = m computeLocalVarsIndex(m) diff --git a/src/reflect/scala/reflect/internal/ClassfileConstants.scala b/src/reflect/scala/reflect/internal/ClassfileConstants.scala index faf61e5205..b682b7d0ca 100644 --- a/src/reflect/scala/reflect/internal/ClassfileConstants.scala +++ b/src/reflect/scala/reflect/internal/ClassfileConstants.scala @@ -9,7 +9,6 @@ package internal import scala.annotation.switch object ClassfileConstants { - final val JAVA_MAGIC = 0xCAFEBABE final val JAVA_MAJOR_VERSION = 45 final val JAVA_MINOR_VERSION = 3 |