Check-in [f7fe0f7589]

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

Overview
Comment:Add check for interface types as well.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f7fe0f75898c36a4fdbbea096431a4a556752164
User & Date: stephanie.gawroriski 2019-06-12 22:19:56
Context
2019-06-13
07:02
Backup developer notes. check-in: 4e02fc749f user: squirreljme tags: trunk
2019-06-12
22:19
Add check for interface types as well. check-in: f7fe0f7589 user: stephanie.gawroriski tags: trunk
22:16
Implement jvmCanArrayStore(). check-in: cef945116b user: stephanie.gawroriski tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to runt/klib/supervisor/cc/squirreljme/jvm/JVMFunction.java.

200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
...
215
216
217
218
219
220
221
222













223
224
225
226
227
228
229
		if (pcl == __cldx)
			return 1;
		
		// Corrupted object?
		if (pcl == 0 || pcl == Constants.BAD_MAGIC)
			throw new VirtualMachineError();
		
		// Scan through
		ClassInfo mine = Assembly.pointerToClassInfo(pcl);
		for (ClassInfo seek = mine; seek != null; seek = seek.superclass)
		{
			// Get self pointer
			int selfptr = seek.selfptr;
			
			// Make sure we are not reading bad memory
................................................................................
			if (selfptr == Constants.BAD_MAGIC)
				throw new VirtualMachineError();
			
			// Same as this one?
			if (selfptr == __cldx)
				return 1;
			
			// Check interfaces, if any













		}
		
		// Not a match
		return 0;
	}
	
	/**







|







 







|
>
>
>
>
>
>
>
>
>
>
>
>
>







200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
...
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
		if (pcl == __cldx)
			return 1;
		
		// Corrupted object?
		if (pcl == 0 || pcl == Constants.BAD_MAGIC)
			throw new VirtualMachineError();
		
		// Scan through super classes and check
		ClassInfo mine = Assembly.pointerToClassInfo(pcl);
		for (ClassInfo seek = mine; seek != null; seek = seek.superclass)
		{
			// Get self pointer
			int selfptr = seek.selfptr;
			
			// Make sure we are not reading bad memory
................................................................................
			if (selfptr == Constants.BAD_MAGIC)
				throw new VirtualMachineError();
			
			// Same as this one?
			if (selfptr == __cldx)
				return 1;
			
			// See if our class or any of our super class implemented
			// interfaces matches the target class
			for (ClassInfo xface : mine.interfaceclasses)
			{
				int ifaceptr = xface.selfptr;
				
				// Make sure we are not reading bad memory
				if (ifaceptr == Constants.BAD_MAGIC)
					throw new VirtualMachineError();
				
				// Is a match?
				if (ifaceptr == __cldx)
					return 1;
			}
		}
		
		// Not a match
		return 0;
	}
	
	/**