From 5d2b5b8892cc6e714565326b70d7c6a4b7007129 Mon Sep 17 00:00:00 2001 From: aclement Date: Fri, 12 May 2006 08:17:43 +0000 Subject: test and fix for 138384: woven methods being >64k in code size --- .../src/org/aspectj/apache/bcel/generic/InstructionList.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'bcel-builder/src') diff --git a/bcel-builder/src/org/aspectj/apache/bcel/generic/InstructionList.java b/bcel-builder/src/org/aspectj/apache/bcel/generic/InstructionList.java index 55cfc95db..cf0fb321a 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/generic/InstructionList.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/generic/InstructionList.java @@ -75,7 +75,7 @@ import java.util.ArrayList; * A list is finally dumped to a byte code array with getByteCode. * - * @version $Id: InstructionList.java,v 1.3 2006/02/14 13:32:07 aclement Exp $ + * @version $Id: InstructionList.java,v 1.4 2006/05/12 08:17:43 aclement Exp $ * @author M. Dahm * @see Instruction * @see InstructionHandle @@ -986,8 +986,11 @@ public class InstructionList implements Serializable { System.err.println(e); return null; } + byte[] byteCode = b.toByteArray(); + if (byteCode.length > Constants.MAX_CODE_SIZE) + throw new ClassGenException("Code size too big: " + byteCode.length); - return b.toByteArray(); + return byteCode; } /** -- cgit v1.2.3