From 5b937bacd38c34718e16989f3752e1f582ae2698 Mon Sep 17 00:00:00 2001 From: Gilles Dubochet Date: Thu, 29 Apr 2010 17:01:22 +0000 Subject: 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. --- src/fjbg/ch/epfl/lamp/fjbg/JConstantPool.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/fjbg/ch/epfl/lamp') 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); } -- cgit v1.2.3