mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2026-11-26 23:29:02 +00:00
With SDSORT_USES_RAM minus SDSORT_CACHE_NAMES and SDSORT_USES_STACK, the sortnames pointer is declared (as its declaration covers DISABLED(SDSORT_USES_STACK)) but the constructor only assigned it under ENABLED(SDSORT_CACHE_NAMES). presort() then writes through the NULL pointer via SET_SORTNAME, hard-faulting the board (e.g. LPC1768) as soon as an SD card with two or more files is mounted. Assign sortnames whenever it is declared and not heap-allocated: whenever SDSORT_DYNAMIC_RAM is off and either SDSORT_CACHE_NAMES is on or SDSORT_USES_STACK is off. This also skips the wasted static allocation when SDSORT_DYNAMIC_RAM applies. Add a build test (LPC1768/config-07) covering the crashing combo. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| bin | ||
| etc/udev/rules.d | ||
| share | ||
| skills | ||
| test-gcode | ||
| tests | ||
| web-ui/data/www | ||