Skip to content

Commit

Permalink
Fix NestHost length computation
Browse files Browse the repository at this point in the history
Fixes bazelbuild#5987

PiperOrigin-RevId: 212658573
  • Loading branch information
cushon authored and Copybara-Service committed Sep 12, 2018
1 parent 66e1097 commit b073a18
Show file tree
Hide file tree
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
Expand Up @@ -1201,7 +1201,7 @@ struct NestHostAttribute : Attribute {
}

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

Expand Down
5 changes: 5 additions & 0 deletions third_party/ijar/test/ijar_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit b073a18

Please sign in to comment.