unix/main: Make static variable that's potentially clobbered by longjmp.

This fixes `error: variable 'subpkg_tried' might be clobbered by 'longjmp'
or 'vfork' [-Werror=clobbered]` when compiling on ppc64le and aarch64 (and
possibly other architectures/toolchains).
pull/6925/head
Marian Buschsieweke 2021-03-30 20:08:11 +02:00 zatwierdzone przez Damien George
rodzic 2ac09c2694
commit 9c9bfe1968
1 zmienionych plików z 6 dodań i 1 usunięć

Wyświetl plik

@ -596,7 +596,12 @@ MP_NOINLINE int main_(int argc, char **argv) {
mp_obj_t mod;
nlr_buf_t nlr;
bool subpkg_tried = false;
// Allocating subpkg_tried on the stack can lead to compiler warnings about this
// variable being clobbered when nlr is implemented using setjmp/longjmp. Its
// value must be preserved across calls to setjmp/longjmp.
static bool subpkg_tried;
subpkg_tried = false;
reimport:
if (nlr_push(&nlr) == 0) {