Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ChkCastClassSpecial()

static unsafe object System.Runtime.CompilerServices.CastHelpers.ChkCastClassSpecial ( void * toTypeHnd,
object obj )
inlinestaticprivate

Definition at line 367 of file CastHelpers.cs.

368 {
369 MethodTable* ptr = RuntimeHelpers.GetMethodTable(obj);
370 while (true)
371 {
372 ptr = ptr->ParentMethodTable;
373 if (ptr != toTypeHnd)
374 {
375 if (ptr == null)
376 {
377 break;
378 }
379 ptr = ptr->ParentMethodTable;
380 if (ptr != toTypeHnd)
381 {
382 if (ptr == null)
383 {
384 break;
385 }
386 ptr = ptr->ParentMethodTable;
387 if (ptr != toTypeHnd)
388 {
389 if (ptr == null)
390 {
391 break;
392 }
393 ptr = ptr->ParentMethodTable;
394 if (ptr != toTypeHnd)
395 {
396 if (ptr == null)
397 {
398 break;
399 }
400 continue;
401 }
402 }
403 }
404 }
405 return obj;
406 }
407 return ChkCast_Helper(toTypeHnd, obj);
408 }
static unsafe object ChkCast_Helper(void *toTypeHnd, object obj)

References System.Runtime.CompilerServices.CastHelpers.ChkCast_Helper(), System.Runtime.CompilerServices.RuntimeHelpers.GetMethodTable(), System.obj, and System.Runtime.CompilerServices.MethodTable.ParentMethodTable.

Referenced by System.Runtime.CompilerServices.CastHelpers.ChkCastClass().