From b023f4074bf329928d78eecce107f62a32eb1115 Mon Sep 17 00:00:00 2001 From: Zachary Spriggs Date: Fri, 9 Apr 2021 12:35:51 -0400 Subject: [PATCH] Fix bug with _BIT variables in functions This fix references forum post https://www.qb64.org/forum/index.php?topic=3794.msg131521#msg131521 A C++ error would occur when using a `_BIT` variable as a function argument because our current handling of the translation would reinitialize the variable in the function. This is called shadowing a parameter. I have commented out the line that was causing the error. The code that was provided in the forum post works successfully with this fix. --- source/qb64.bas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/qb64.bas b/source/qb64.bas index 839474a32..af11925a6 100644 --- a/source/qb64.bas +++ b/source/qb64.bas @@ -14362,7 +14362,7 @@ FUNCTION dim2 (varname$, typ2$, method, elements$) END IF 'standard bit-length variable n$ = scope2$ + n$ - PRINT #defdatahandle, ct$ + " *" + n$ + "=NULL;" + 'PRINT #defdatahandle, ct$ + " *" + n$ + "=NULL;" PRINT #13, "if(" + n$ + "==NULL){" PRINT #13, "cmem_sp-=4;" PRINT #13, "if (cmem_sp