The different def_glob macros for primitive global variables each use an incorrect designator order, not matching the declaration order in Global. This is the case for all platforms supporting primitive global installation.
#define def_glob(name, type, mut, init_value) \
StackValue name##_sv{.value_type = type, init_value}; \
Global name = { \
.mutability = mut, .import_field = #name, .value = &name##_sv};
While the global struct is defined as:
typedef struct Global {
char *export_name; // export name of the global
char *import_module; // import module name
char *import_field; // import field name
bool mutability; // 0: immutable, 1: mutable
StackValue *value; // current value
} Global;
This results in a compiler error and breaks CI when the def_glob macro is used:
error: designator order for field ‘Global::import_field’ does not match declaration order in ‘Global’
The error was not catched in #329 since that PR didn't include any effective use of those primitive global variables.
The different
def_globmacros for primitive global variables each use an incorrect designator order, not matching the declaration order inGlobal. This is the case for all platforms supporting primitive global installation.While the global struct is defined as:
This results in a compiler error and breaks CI when the
def_globmacro is used:The error was not catched in #329 since that PR didn't include any effective use of those primitive global variables.