Local count too large

Uncaught (in promise) CompileError: WebAssembly.instantiate(): Compiling function #5837:“ms_t16_AIANFPA285_1AIANFPA2858__d_cctor” failed: local count too large @+2670705

We’ll probably need a test case for this. do you have a lot of locals?

Sorry, been programming long time but don’t know what “locals” are. I’ve added a new data file,
DatCities.pas that has only constants, a list of 6 col indexes:
xST = 0
xCtiy = 1
xCounty = 2
. . .
xCityY = 5

And 237 Cities:
sZoneTMY : Array[0…nCities, xST…xCityY] of String = (. . .) ; (237 lines of 6col each of string data for each city.

& the data:

For now just adding the data. Nothing done with it yet. Compiles w/ success but gets “locals” error. Remove the file & runs like before.

Adding such Dat file of data is assumed Global data which can be used by several pas modules.

The application has 12,000 lines of source code in 25 pas files.

Perhaps normal or weird but the data files start with “Dat…”, e.g. DatCities.pas in this example. Some have only data & some have data with a few small supporting methods, like to get some data, etc. The program files follow the Dat.files by alphabetic name. Recently I added a Dat file not beginning with “Dat” & it alphabetically mixed with the Method-type.pas file & some methods could not find the Data until I preceded the file name with “Dat” putting it ahead of the Method-type.pas files. Then it found the data.

Gets “locals” error with any more than 216 cities in the Cities Array. Must be a memory problem of some kind. Browser memory? Anything you know of I can do about it? There is a lot of data in the Ap & eventually there will be 1000 cities when it can’t handle 237 & there will be more data. Maybe I need to include only the necessary data & retrieve the rest from the Server when needed? Then it won’t be a self-contained Ap & any breakage in the link to the server will cause the Ap to not run. The Total WASM file is about 9MB.

Gotta quit for day, feed myself & daughter, watch TV, drink 2 beers & head to bed. Look forward to your reply tomorrow. --tex

Local variables in a method. i could imagine from the error that maybe WebAssemly has some limit, if you have way too many.

Getting a full project that shows this would greatly help; i am traveling this week, and i could try reproduce this myself when i’m back in office later next week; but to log it for the compiler team now, i’d need a full test case.