[Ikvm-developers] Code quality issues - Infinite loop
Brought to you by:
jfrijters
|
From: Marius U. <mar...@xa...> - 2013-11-01 05:20:02
|
Hey guys! Sorry if this email got sent twice, I sent it by mistake before subscribing to the mailing list, and I think it didn't get through. I was checking out code with a source analysis tool open and noticed these two issues [0]. To explain this issue, I need to add more context [1]. As you can see, we're casting to a nullable type. The first null check is perfect, so we don't have issues from the 'as' cast. But then, we send the MemberRefKey? variable, for example, and it the method that's used is Equals(object), not Equals(MemberRefKey). Therefore, adding a .HasValue and .Value should fix this infinite loop we could hit on. Thanks! [0] - https://gist.github.com/Therzok/1003436f65b804ecec67 [1] - https://gist.github.com/Therzok/ba503926bd5bd11692c1 |