@@ -1171,8 +1171,10 @@ typedef enum {
1171
1171
FROZEN_BAD_NAME , // The given module name wasn't valid.
1172
1172
FROZEN_NOT_FOUND , // It wasn't in PyImport_FrozenModules.
1173
1173
FROZEN_DISABLED , // -X frozen_modules=off (and not essential)
1174
- FROZEN_EXCLUDED , // The PyImport_FrozenModules entry has NULL "code".
1175
- FROZEN_INVALID , // The PyImport_FrozenModules entry is bogus.
1174
+ FROZEN_EXCLUDED , /* The PyImport_FrozenModules entry has NULL "code"
1175
+ (module is present but marked as unimportable, stops search). */
1176
+ FROZEN_INVALID , /* The PyImport_FrozenModules entry is bogus
1177
+ (eg. does not contain executable code). */
1176
1178
} frozen_status ;
1177
1179
1178
1180
static inline void
@@ -1305,6 +1307,7 @@ find_frozen(PyObject *nameobj, struct frozen_info *info)
1305
1307
return FROZEN_EXCLUDED ;
1306
1308
}
1307
1309
if (p -> code [0 ] == '\0' || p -> size == 0 ) {
1310
+ /* Does not contain executable code. */
1308
1311
return FROZEN_INVALID ;
1309
1312
}
1310
1313
return FROZEN_OKAY ;
@@ -1315,6 +1318,7 @@ unmarshal_frozen_code(struct frozen_info *info)
1315
1318
{
1316
1319
PyObject * co = PyMarshal_ReadObjectFromString (info -> data , info -> size );
1317
1320
if (co == NULL ) {
1321
+ /* Does not contain executable code. */
1318
1322
set_frozen_error (FROZEN_INVALID , info -> nameobj );
1319
1323
return NULL ;
1320
1324
}
@@ -2214,6 +2218,7 @@ _imp_get_frozen_object_impl(PyObject *module, PyObject *name,
2214
2218
info .nameobj = name ;
2215
2219
}
2216
2220
if (info .size == 0 ) {
2221
+ /* Does not contain executable code. */
2217
2222
set_frozen_error (FROZEN_INVALID , name );
2218
2223
return NULL ;
2219
2224
}
0 commit comments