From 5a48e96bb2557ea3217d7136f9c8d6a0df77bffb Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Fri, 2 Sep 2022 17:15:27 +1000 Subject: [PATCH] fix(developer): compiler mismatch on currentLine Fixes #7122. The compiler was updating currentLine when checking for unreachable rules, but not restoring it afterwards. This led to mismatches in the debugger and in compiler warnings. --- windows/src/developer/kmcmpdll/DeprecationChecks.cpp | 4 ++-- windows/src/developer/kmcmpdll/UnreachableRules.cpp | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/windows/src/developer/kmcmpdll/DeprecationChecks.cpp b/windows/src/developer/kmcmpdll/DeprecationChecks.cpp index ff8df78b99..d3df9a43a5 100644 --- a/windows/src/developer/kmcmpdll/DeprecationChecks.cpp +++ b/windows/src/developer/kmcmpdll/DeprecationChecks.cpp @@ -26,7 +26,7 @@ BOOL CheckForDeprecatedFeatures(PFILE_KEYBOARD fk) { // Keyman 7 #define TSS_WINDOWSLANGUAGES 29 */ - int currentLineBackup = currentLine; + int oldCurrentLine = currentLine; DWORD i; PFILE_STORE sp; @@ -47,7 +47,7 @@ BOOL CheckForDeprecatedFeatures(PFILE_KEYBOARD fk) { } } - currentLine = currentLineBackup; + currentLine = oldCurrentLine; return TRUE; } diff --git a/windows/src/developer/kmcmpdll/UnreachableRules.cpp b/windows/src/developer/kmcmpdll/UnreachableRules.cpp index c6369672a3..e2900a4925 100644 --- a/windows/src/developer/kmcmpdll/UnreachableRules.cpp +++ b/windows/src/developer/kmcmpdll/UnreachableRules.cpp @@ -25,6 +25,8 @@ DWORD VerifyUnreachableRules(PFILE_GROUP gp) { PFILE_KEY kp = gp->dpKeyArray; DWORD i; + int oldCurrentLine = currentLine; + std::unordered_map map; std::unordered_set reportedLines; @@ -44,5 +46,7 @@ DWORD VerifyUnreachableRules(PFILE_GROUP gp) { } } + currentLine = oldCurrentLine; + return CERR_None; }