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.
This commit is contained in:
Marc Durdin 2022-09-02 17:15:27 +10:00
parent fc21e8359e
commit 5a48e96bb2
2 changed files with 6 additions and 2 deletions

View file

@ -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;
}

View file

@ -25,6 +25,8 @@ DWORD VerifyUnreachableRules(PFILE_GROUP gp) {
PFILE_KEY kp = gp->dpKeyArray;
DWORD i;
int oldCurrentLine = currentLine;
std::unordered_map<std::wstring, FILE_KEY> map;
std::unordered_set<int> reportedLines;
@ -44,5 +46,7 @@ DWORD VerifyUnreachableRules(PFILE_GROUP gp) {
}
}
currentLine = oldCurrentLine;
return CERR_None;
}