Skip to content

Commit 57eaae4

Browse files
Potential fix for code scanning alert no. 71: Constant condition (#161)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent db071d5 commit 57eaae4

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Engine/StackResolver.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,11 +235,9 @@ private string ProcessFrameModuleOffset(Dictionary<string, DiaUtil> _diautils, D
235235
// make sure we cleanup COM allocations for the resolved sym
236236
Marshal.FinalReleaseComObject(mysym);
237237
result = (inlineFrameAndSourceInfo + symbolizedFrame + "\t" + sourceInfo).Trim();
238-
if (!resWasCached) { // we only need to add to cache if it was not already cached.
239-
this.rwLockCachedSymbols.AcquireWriterLock(-1);
240-
if (!this.cachedSymbols.ContainsKey(symKey)) this.cachedSymbols.Add(symKey, result);
241-
this.rwLockCachedSymbols.ReleaseWriterLock();
242-
}
238+
this.rwLockCachedSymbols.AcquireWriterLock(-1);
239+
if (!this.cachedSymbols.ContainsKey(symKey)) this.cachedSymbols.Add(symKey, result);
240+
this.rwLockCachedSymbols.ReleaseWriterLock();
243241
}
244242

245243
if (frameNum != int.MinValue) {

0 commit comments

Comments
 (0)