Check-in [aade498ed0]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Some corrections.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:aade498ed0e45efd2f99c9ebdbfa7cccbaa531e7
User & Date: stephanie.gawroriski 2019-04-17 16:48:58
Context
2019-04-17
17:23
Add pool entries for the class names and such before they are used. check-in: e7d44ac640 user: stephanie.gawroriski tags: trunk
16:48
Some corrections. check-in: aade498ed0 user: stephanie.gawroriski tags: trunk
16:36
Add the read padding byte to the error message. check-in: 274fc0cd3e user: stephanie.gawroriski tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to runt/libs/tool-classfile/dev/shadowtail/classfile/mini/MinimizedPool.java.

126
127
128
129
130
131
132
133

134
135
136
137
138
139
140
		todo.DEBUG.note("Decode %d (%d bytes @ %d)", __n, __l, __o);
		
		// Read the type and offset table
		try (DataInputStream dis = new DataInputStream(
			new ByteArrayInputStream(__is, __o, __l)))
		{
			// Read type table
			dis.readFully(types);

			
			// {@squirreljme.error JC44 Pool uneven padding byte was not
			// 255. (The value it was)}
			if ((__n & 1) != 0)
			{
				int val;
				if ((val = dis.readUnsignedByte()) != 0xFF)







|
>







126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
		todo.DEBUG.note("Decode %d (%d bytes @ %d)", __n, __l, __o);
		
		// Read the type and offset table
		try (DataInputStream dis = new DataInputStream(
			new ByteArrayInputStream(__is, __o, __l)))
		{
			// Read type table
			for (int i = 0; i < __n; i++)
				types[i] = dis.readByte();
			
			// {@squirreljme.error JC44 Pool uneven padding byte was not
			// 255. (The value it was)}
			if ((__n & 1) != 0)
			{
				int val;
				if ((val = dis.readUnsignedByte()) != 0xFF)

Changes to runt/libs/tool-classfile/dev/shadowtail/classfile/mini/MinimizedPoolBuilder.java.

417
418
419
420
421
422
423




424
425
426
427
428
429
430
431
432
433
434
				Minimizer.__dosRound(ddos);
			}
			
			// End of table padding for the type table?
			if ((poolcount & 1) != 0)
				tdos.writeByte(0xFF);
			




			// Merge the data bytes into the table then use the completed
			// table
			tbytes.write(obytes.toByteArray());
			tbytes.write(dbytes.toByteArray());
			return tbytes.toByteArray();
		}
		
		// Should not occur
		catch (IOException e)
		{
			throw new RuntimeException(e);







>
>
>
>


|
|







417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
				Minimizer.__dosRound(ddos);
			}
			
			// End of table padding for the type table?
			if ((poolcount & 1) != 0)
				tdos.writeByte(0xFF);
			
			// Debug
			todo.DEBUG.note("Pool Sizes: t=%d o=%d d=%d",
				tdos.size(), odos.size(), ddos.size());
			
			// Merge the data bytes into the table then use the completed
			// table
			tdos.write(obytes.toByteArray());
			tdos.write(dbytes.toByteArray());
			return tbytes.toByteArray();
		}
		
		// Should not occur
		catch (IOException e)
		{
			throw new RuntimeException(e);

Changes to runt/libs/tool-classfile/dev/shadowtail/classfile/mini/Minimizer.java.

204
205
206
207
208
209
210



211
212
213
214
215
216
217
		// data areas or similar if needed
		__dos.writeInt(reloff + 4);
		__dos.writeInt((reloff - baserel) + 4);
		
		// Constant pool is rounded
		Minimizer.__dosRound(__dos);
		



		// Write constant pool
		__dos.write(pooldata);
		Minimizer.__dosRound(__dos);
		
		// Write field data
		for (int i = 0; i < 2; i++)
		{







>
>
>







204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
		// data areas or similar if needed
		__dos.writeInt(reloff + 4);
		__dos.writeInt((reloff - baserel) + 4);
		
		// Constant pool is rounded
		Minimizer.__dosRound(__dos);
		
		// Debug
		todo.DEBUG.note("Writing pool at %d", __dos.size());
		
		// Write constant pool
		__dos.write(pooldata);
		Minimizer.__dosRound(__dos);
		
		// Write field data
		for (int i = 0; i < 2; i++)
		{