sync with dc5d2b9

This commit is contained in:
2025-03-05 22:55:46 +08:00
parent 5e1c4037a9
commit a2b8ab1205
6 changed files with 145 additions and 35 deletions

View File

@@ -67,8 +67,8 @@ void PycCode::load(PycData* stream, PycModule* mod)
if (mod->verCompare(3, 8) < 0) {
// Remap flags to new values introduced in 3.8
if (m_flags & 0xF0000000)
throw std::runtime_error("Cannot remap unexpected flags");
m_flags = (m_flags & 0xFFFF) | ((m_flags & 0xFFF0000) << 4);
fprintf(stderr, "Remapping flags (%08X) may not be correct\n", m_flags);
m_flags = (m_flags & 0x1FFF) | ((m_flags & 0xFFFE000) << 4);
}
m_code = LoadObject(stream, mod).cast<PycString>();