1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-07-04 23:30:24 +00:00

Prevents adding SHARED variables to SUB vWatch()

This commit is contained in:
FellippeHeitor 2021-07-24 12:00:40 -03:00
parent 6436ee76bf
commit c621917a69

View file

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