fix: PyarmorAssert bytes marshal type as new module

This commit is contained in:
2025-09-13 13:52:44 +08:00
parent 747ed7cf50
commit 3254e3b70c
4 changed files with 20 additions and 4 deletions

View File

@@ -101,7 +101,9 @@ PycRef<ASTNode> PyarmorMixStrDecrypt(const std::string &inputString, PycModule *
case 2:
{
PycBuffer buf(result.data(), (int)result.length());
return new ASTObject(LoadObject(&buf, mod));
PycModule temp_mod;
temp_mod.copyFrom(*mod);
return new ASTObject(LoadObject(&buf, &temp_mod));
}
case 3:
{
@@ -112,7 +114,9 @@ PycRef<ASTNode> PyarmorMixStrDecrypt(const std::string &inputString, PycModule *
case 4:
{
PycBuffer buf(result.data(), (int)result.length());
auto obj = new ASTObject(LoadObject(&buf, mod));
PycModule temp_mod;
temp_mod.copyFrom(*mod);
auto obj = new ASTObject(LoadObject(&buf, &temp_mod));
// (pyarmor__1, pyarmor__2, pyarmor__3) = ('builtins', ('enumerate', 'ImportError', 'hasattr'), 0)
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
auto tuple = obj->object().try_cast<PycTuple>();