freebasic / fbc

FreeBASIC is a completely free, open-source, multi-platform BASIC compiler, with syntax similar to MS-QuickBASIC, that adds new features such as pointers, object orientation, unsigned data types, inline assembly, and many others.
https://www.freebasic.net
905 stars 139 forks source link

fbc64 version 1.20 crashed under Windows 10 64 bit #423

Open LukyGuyLucky opened 8 months ago

LukyGuyLucky commented 8 months ago

Trying to compile 2 examples in https://github.com/jepalza/FB_DOOM_LIKE ,the fbc64 version 1.2 crashed during compiling process,but version 1.1 is fine.

jayrm commented 8 months ago

1.2 crashed during compiling process,but version 1.1 is fine.

I think versions should be '1.20 crashed during compiling process,but version 1.10 is fine'

Cause is due to bug #798 fbc's recursive AST storage & traversal breaks with huge initializers

In the doom like source code (textures) we have:

'' array size is 27180
Dim Shared As Byte T_NUMBERS(...)  = { _
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _

The change could have been from any work done on fbc compiler. Because initializer list is solved through recursion, a change to any of fbc's internal procedures used by initializer handling can affect how much stack space is used and therefore affect how many calls are possible before the stack is ultimately exhausted and crashes fbc, thus the current limiting factor on length of initializer lists.