Skip to content

Commit ec6c792

Browse files
committed
Fixed an issue where the line number and column number could change for the same thrown exception
The line number and column numbers were changing inside of a for loop that had a try catch block..
1 parent cf19eec commit ec6c792

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

Source/Shared/Models/Client/Data/Method.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public override int GetHashCode() {
3939
hashCode = (hashCode * 397) ^ (DeclaringNamespace == null ? 0 : DeclaringNamespace.GetHashCode());
4040
hashCode = (hashCode * 397) ^ (DeclaringType == null ? 0 : DeclaringType.GetHashCode());
4141
hashCode = (hashCode * 397) ^ (Name == null ? 0 : Name.GetHashCode());
42-
hashCode = (hashCode * 397) ^ (Data == null ? 0 : Data.GetCollectionHashCode(new[] { "ILOffset" }));
42+
hashCode = (hashCode * 397) ^ (Data == null ? 0 : Data.GetCollectionHashCode(new[] { "ILOffset", "NativeOffset" }));
4343
hashCode = (hashCode * 397) ^ (GenericArguments == null ? 0 : GenericArguments.GetCollectionHashCode());
4444
hashCode = (hashCode * 397) ^ (Parameters == null ? 0 : Parameters.GetCollectionHashCode());
4545
return hashCode;

Source/Shared/Models/Client/Data/StackFrame.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public class StackFrame : Method {
77
public int Column { get; set; }
88

99
protected bool Equals(StackFrame other) {
10-
return base.Equals(other) && string.Equals(FileName, other.FileName) && LineNumber == other.LineNumber && Column == other.Column;
10+
return base.Equals(other) && string.Equals(FileName, other.FileName);
1111
}
1212

1313
public override bool Equals(object obj) {
@@ -24,8 +24,6 @@ public override int GetHashCode() {
2424
unchecked {
2525
int hashCode = base.GetHashCode();
2626
hashCode = (hashCode * 397) ^ (FileName == null ? 0 : FileName.GetHashCode());
27-
hashCode = (hashCode * 397) ^ LineNumber;
28-
hashCode = (hashCode * 397) ^ Column;
2927
return hashCode;
3028
}
3129
}

0 commit comments

Comments
 (0)