[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <53465558.8090300@gentoo.org>
Date: Thu, 10 Apr 2014 04:24:56 -0400
From: Jonathan Callen <jcallen@...too.org>
To: Randy Dunlap <rdunlap@...radead.org>
CC: linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Documentation/java.txt: add Java 7 support
On 04/09/2014 12:21 PM, Randy Dunlap wrote:
> On 03/30/2014 08:47 PM, Jonathan Callen wrote:
>> The sample wrapper currently fails on some Java 7 .class files. This
>> updates the wrapper to properly handle those files.
>>
>> Signed-off-by: Jonathan Callen <jcallen@...too.org>
>
> Applied. Thanks.
>
> How would I test this?
>
I have attached a hand-crafted HelloWorld.class file that fails unless this patch is applied. This
.class file intentionally has extra entries in its constant pool that are not used by Java, but the
file does pass validation.
A complete disassembly of that file, showing the purpose of each byte, is attached as HelloWorld.jj.
>
>> ---
>> Documentation/java.txt | 8 ++++++++
>> 1 file changed, 8 insertions(+)
>>
>> diff --git a/Documentation/java.txt b/Documentation/java.txt
>> index e6a7232..4180205 100644
>> --- a/Documentation/java.txt
>> +++ b/Documentation/java.txt
>> @@ -188,6 +188,9 @@ shift
>> #define CP_METHODREF 10
>> #define CP_INTERFACEMETHODREF 11
>> #define CP_NAMEANDTYPE 12
>> +#define CP_METHODHANDLE 15
>> +#define CP_METHODTYPE 16
>> +#define CP_INVOKEDYNAMIC 18
>>
>> /* Define some commonly used error messages */
>>
>> @@ -242,14 +245,19 @@ void skip_constant(FILE *classfile, u_int16_t *cur)
>> break;
>> case CP_CLASS:
>> case CP_STRING:
>> + case CP_METHODTYPE:
>> seekerr = fseek(classfile, 2, SEEK_CUR);
>> break;
>> + case CP_METHODHANDLE:
>> + seekerr = fseek(classfile, 3, SEEK_CUR);
>> + break;
>> case CP_INTEGER:
>> case CP_FLOAT:
>> case CP_FIELDREF:
>> case CP_METHODREF:
>> case CP_INTERFACEMETHODREF:
>> case CP_NAMEANDTYPE:
>> + case CP_INVOKEDYNAMIC:
>> seekerr = fseek(classfile, 4, SEEK_CUR);
>> break;
>> case CP_LONG:
>>
>
>
Download attachment "HelloWorld.class" of type "application/java-vm" (349 bytes)
View attachment "HelloWorld.jj" of type "text/plain" (6791 bytes)
Download attachment "signature.asc" of type "application/pgp-signature" (902 bytes)
Powered by blists - more mailing lists