Segmentation violation when ending this code:
Screenres 700, 600, 32 View (100, 100)-(600, 500) Color &H0000AA 'Line (0, 0)-(500, 400),, B Paint (250, 200) Sleep
The fault occurs when the PAINT instruction fills an unlimited area (without encounter a delimitation border of matched color) in a viewport.
If before using PAINT, one draws a matched color delimitation border at the limits of the viewport (line 'Line (0, 0)-(500, 400),, B' uncommented), the behavior becomes right.
proposed fix at
https://github.com/freebasic/fbc/pull/86
The proposed patch will correct the segfault. Not saying that the PAINT algo is completely bug free, it should be tested more.
Problem was: wrong calculation for row when updating fbgfx "dirty" array, caused memory corruption due to accessing memory beyond the array.
Fixed in
https://github.com/freebasic/fbc/pull/86/commits/ee938e2cd17aae4a696771bbc4ea4c6857d004e0