Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix NestHost length computation
Browse files Browse the repository at this point in the history
Fixes #5987

PiperOrigin-RevId: 212658573
cushon authored and meteorcloudy committed Nov 29, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 67210df commit 3559b5c
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion third_party/ijar/classfile.cc
Original file line number Diff line number Diff line change
@@ -1201,7 +1201,7 @@ struct NestHostAttribute : Attribute {
}

void Write(u1 *&p) {
WriteProlog(p, -1);
WriteProlog(p, 2);
put_u2be(p, host_class_index_->slot());
}

5 changes: 5 additions & 0 deletions third_party/ijar/test/ijar_test.sh
Original file line number Diff line number Diff line change
@@ -521,9 +521,14 @@ function test_method_parameters_attribute() {
function test_nestmates_attribute() {
# Check that Java 11 NestMates attributes are preserved
$IJAR $NESTMATES_JAR $NESTMATES_IJAR || fail "ijar failed"

$JAVAP -classpath $NESTMATES_IJAR -v NestTest >& $TEST_log \
|| fail "javap failed"
expect_log "NestMembers" "NestMembers not preserved!"

$JAVAP -classpath $NESTMATES_IJAR -v 'NestTest$P' >& $TEST_log \
|| fail "javap failed"
expect_log "NestHost" "NestHost not preserved!"
}

function test_source_debug_extension_attribute() {

0 comments on commit 3559b5c

Please sign in to comment.