PMunch / ratel

128 stars 4 forks source link

Investigate PROGMEM in global scope #5

Closed PMunch closed 2 years ago

PMunch commented 2 years ago

While working on https://github.com/nim-lang/Nim/pull/19545 I noticed that when placing strings defined with p"something" in the global scope the progmem macro broke. This is because the definition is moved to the top of the file (and looks like it's properly formed), but then Nim decides to call zeroMem on it when the main procedure starts. This would probably crash the microcontroller (not allowed to write to progmem). So this needs to be investigated. @yglukhov you had some ideas for a rewrite of the PROGMEM system IIRC?

PMunch commented 2 years ago

This should be fixed via https://github.com/PMunch/ratel/commit/7b0c0538c0221cebd7fd71d0a7a1ea115e6c052a