py/persistentcode: Initialize prelude_ptr to prevent compiler warning.

The esp32 IDF toolchain can give a "may be used uninitialized" warning, at
least for ESP32-S3 with gcc 14.2.0.  Silence that warning by initializing
the variable with NULL.

Co-authored-by: Daniel van de Giessen <daniel@dvdgiessen.nl>
Signed-off-by: IhorNehrutsa <Ihor.Nehrutsa@gmail.com>
This commit is contained in:
IhorNehrutsa 2025-01-21 09:55:55 +02:00 committed by Damien George
parent 865a4c8bf6
commit a4ab847688

View file

@ -402,7 +402,7 @@ static mp_raw_code_t *load_raw_code(mp_reader_t *reader, mp_module_context_t *co
#if MICROPY_EMIT_MACHINE_CODE
} else {
const uint8_t *prelude_ptr;
const uint8_t *prelude_ptr = NULL;
#if MICROPY_EMIT_NATIVE_PRELUDE_SEPARATE_FROM_MACHINE_CODE
if (kind == MP_CODE_NATIVE_PY) {
// Executable code cannot be accessed byte-wise on this architecture, so copy