diff --git a/src/share/native/com/sun/java/util/jar/pack/unpack.cpp b/src/share/native/com/sun/java/util/jar/pack/unpack.cpp index bc91827f66c4a94f97bfe961e70aa3b3eeffbcee..4b5e38a0de13c2a95d045990a018311bede13ee8 100644 --- a/src/share/native/com/sun/java/util/jar/pack/unpack.cpp +++ b/src/share/native/com/sun/java/util/jar/pack/unpack.cpp @@ -4758,8 +4758,8 @@ int unpacker::write_bsms(int naOffset, int na) { PTRLIST_QSORT(cp.requested_bsms, outputEntry_cmp); // append the BootstrapMethods attribute (after the InnerClasses attr): putref(cp.sym[cpool::s_BootstrapMethods]); + // make a note of the offset, for lazy patching int sizeOffset = (int)wpoffset(); - byte* sizewp = wp; putu4(-99); // attr size will be patched putu2(cur_class_local_bsm_count); int written_bsms = 0; @@ -4776,6 +4776,7 @@ int unpacker::write_bsms(int naOffset, int na) { written_bsms += 1; } assert(written_bsms == cur_class_local_bsm_count); // else insane + byte* sizewp = wp_at(sizeOffset); putu4_at(sizewp, (int)(wp - (sizewp+4))); // size of code attr putu2_at(wp_at(naOffset), ++na); // increment class attr count } diff --git a/test/tools/pack200/Pack200Test.java b/test/tools/pack200/Pack200Test.java index 476ece182168f60d07196213cdeb58350068a801..d897bf8682491d12d56a7c8a3526717d05277a31 100644 --- a/test/tools/pack200/Pack200Test.java +++ b/test/tools/pack200/Pack200Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,7 @@ import java.util.jar.*; /* * @test - * @bug 6521334 6712743 + * @bug 6521334 6712743 8007902 * @summary check for memory leaks, test general packer/unpacker functionality\ * using native and java unpackers * @compile -XDignore.symbol.file Utils.java Pack200Test.java diff --git a/test/tools/pack200/pack200-verifier/data/golden.jar b/test/tools/pack200/pack200-verifier/data/golden.jar index 913fe14340e22ba8b47f4fdceb2e0b1919cbd370..511cc0f43ab044021c1ed5ff60b76f4da4472e0f 100644 Binary files a/test/tools/pack200/pack200-verifier/data/golden.jar and b/test/tools/pack200/pack200-verifier/data/golden.jar differ