summaryrefslogtreecommitdiff
path: root/src/fjbg
diff options
context:
space:
mode:
authorGilles Dubochet <gilles.dubochet@epfl.ch>2010-04-29 17:01:22 +0000
committerGilles Dubochet <gilles.dubochet@epfl.ch>2010-04-29 17:01:22 +0000
commit5b937bacd38c34718e16989f3752e1f582ae2698 (patch)
tree6b14bd7647a353d9f39f3973a6e0e3444b738066 /src/fjbg
parent8eb1d0c6ac940438b5f81d832dd3d0ab26de1ff5 (diff)
downloadscala-5b937bacd38c34718e16989f3752e1f582ae2698.tar.gz
scala-5b937bacd38c34718e16989f3752e1f582ae2698.tar.bz2
scala-5b937bacd38c34718e16989f3752e1f582ae2698.zip
Closes #3310 (very large Scala class is compile...
Closes #3310 (very large Scala class is compiled to invalid classfile because Scala signature can't fit into constant pool). Review by dragos.
Diffstat (limited to 'src/fjbg')
-rw-r--r--src/fjbg/ch/epfl/lamp/fjbg/JConstantPool.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/fjbg/ch/epfl/lamp/fjbg/JConstantPool.java b/src/fjbg/ch/epfl/lamp/fjbg/JConstantPool.java
index 4fa048177c..0e6b43f1e2 100644
--- a/src/fjbg/ch/epfl/lamp/fjbg/JConstantPool.java
+++ b/src/fjbg/ch/epfl/lamp/fjbg/JConstantPool.java
@@ -383,6 +383,9 @@ public class JConstantPool {
public int getSize() { return 1; }
public void writeContentsTo(DataOutputStream stream) throws IOException {
if (bytes != null) {
+ if (bytes.length > 65535) {
+ throw new IOException("String literal of length " + bytes.length + " does not fit in Classfile");
+ }
stream.writeShort(bytes.length);
stream.write(bytes);
}