Object graph traversal fails when encountering objects of type System.Reflection.Emit.SignatureHelper
|Reported by:||abeham||Owned by:||mkommend|
Calling GetHashCode() to see if it's contained in the HashSet of previously seen objects results in a NullReferenceException.
This type was introduced into the object graph, because I tried to add protocol buffer's ExtensionRegistry as a field to the ExternalEvaluator. I can find another, slightly slower solution for my problem, but the problem remains that object graph traversal is not completely safe.
Line 50 in ObjectExtensions.cs fails:
if (o != null && !objects.Contains(o) && !ExcludeType(o.GetType()))
Excluding this type would require swapping the second and the third check. I don't know if this has performance implications, but I suspect that o.GetType().GetHashCode() is slower than o.GetHashCode().
Change History (9)
comment:1 Changed 5 years ago by mkommend
- Owner changed from swagner to mkommend
- Status changed from new to accepted
comment:4 Changed 5 years ago by mkommend
- Owner changed from mkommend to abeham
- Status changed from accepted to reviewing
comment:5 follow-up: ↓ 6 Changed 5 years ago by abeham
- Owner changed from abeham to mkommend
- Status changed from reviewing to assigned