Skip to content

Commit 5db74a7

Browse files
committed
Report error on code size overflow, log method name.
Same commit as scala/scala@3fa2c97
1 parent 1aa850f commit 5db74a7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

modules/asm/src/dotty/tools/asm/MethodWriter.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1869,7 +1869,12 @@ final int getSize() {
18691869
int size = 8;
18701870
if (code.length > 0) {
18711871
if (code.length > 65536) {
1872-
throw new RuntimeException("Method code too large!");
1872+
String nameString = "";
1873+
int i = 0;
1874+
// find item that corresponds to the index of our name
1875+
while (i < cw.items.length && (cw.items[i] == null || cw.items[i].index != name)) i++;
1876+
if (cw.items[i] != null) nameString = cw.items[i].strVal1 +"'s ";
1877+
throw new RuntimeException("Method "+ nameString +"code too large!");
18731878
}
18741879
cw.newUTF8("Code");
18751880
size += 18 + code.length + 8 * handlerCount;

0 commit comments

Comments
 (0)