From c621917a6983abf27f1ff596b6b33190e370f085 Mon Sep 17 00:00:00 2001 From: FellippeHeitor Date: Sat, 24 Jul 2021 12:00:40 -0300 Subject: [PATCH] Prevents adding SHARED variables to `SUB vWatch()` --- source/qb64.bas | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/source/qb64.bas b/source/qb64.bas index 3ed8ac989..fe89c16d2 100644 --- a/source/qb64.bas +++ b/source/qb64.bas @@ -14261,19 +14261,23 @@ SUB vWatchVariable (this$, action AS _BYTE) mainModuleVariablesList$ = "" totalMainModuleVariables = 0 ELSE - IF totalLocalVariables + totalSharedVariablesFromMainModule > 0 THEN - PRINT #13, "void *vwatch_local_vars["; (totalLocalVariables + totalSharedVariablesFromMainModule); "];" - i = totalLocalVariables - tempShared$ = mainModuleSharedVariablesList$ - tempVar$ = "" - DO UNTIL i = totalLocalVariables + totalSharedVariablesFromMainModule - length = CVL(LEFT$(tempShared$, 4)) - tempVar$ = MID$(tempShared$, 5, length) - tempShared$ = MID$(tempShared$, 5 + length) - localVariablesList$ = localVariablesList$ + "vwatch_local_vars[" + str2$(i) + "] = &" + tempVar$ + ";" + CRLF - i = i + 1 - LOOP - PRINT #13, localVariablesList$ + IF subfunc <> "SUB_VWATCH" THEN + IF totalLocalVariables + totalSharedVariablesFromMainModule > 0 THEN + PRINT #13, "void *vwatch_local_vars["; (totalLocalVariables + totalSharedVariablesFromMainModule); "];" + i = totalLocalVariables + tempShared$ = mainModuleSharedVariablesList$ + tempVar$ = "" + DO UNTIL i = totalLocalVariables + totalSharedVariablesFromMainModule + length = CVL(LEFT$(tempShared$, 4)) + tempVar$ = MID$(tempShared$, 5, length) + tempShared$ = MID$(tempShared$, 5 + length) + localVariablesList$ = localVariablesList$ + "vwatch_local_vars[" + str2$(i) + "] = &" + tempVar$ + ";" + CRLF + i = i + 1 + LOOP + PRINT #13, localVariablesList$ + ELSE + PRINT #13, "void *vwatch_local_vars[0];" + END IF ELSE PRINT #13, "void *vwatch_local_vars[0];" END IF