bmx-ng / bcc

A next-generation bcc parser for BlitzMax
zlib License
33 stars 12 forks source link

Multi-dim-access to a single-dim array with "incorrect" C Code (not caught with BCC error message) #650

Open GWRon opened 10 months ago

GWRon commented 10 months ago

Coming from #649:

SuperStrict
framework brl.standardio

Local arr:Int[10]
arr[0,5] = 10
print arr[5]

Results in:

Building untitled1
[  9%] Processing:untitled1.bmx
[ 91%] Compiling:untitled1.bmx.console.release.linux.x64.c
/BlitzMaxNG/tmp/.bmx/untitled1.bmx.console.release.linux.x64.c: In function ‘_bb_main’:
/BlitzMaxNG/tmp/.bmx/untitled1.bmx.console.release.linux.x64.c:9:50: error: expected expression before ‘]’ token
    9 |                 ((BBINT*)BBARRAYDATA(bbt_arr,1))[]=10;
      |                                                  ^
Build Error: failed to compile (256) /BlitzMaxNG/tmp/.bmx/untitled1.bmx.console.release.linux.x64.c
Process complete

I guess once a "array assignment"-check is added to BCC this would be resolved too.