Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getting an error on STORE_LOCALS #9

Closed
johndpope opened this issue Apr 28, 2016 · 2 comments
Closed

getting an error on STORE_LOCALS #9

johndpope opened this issue Apr 28, 2016 · 2 comments
Labels
insufficient bug report The instructions given when opening a new issue are not followed Unresponsive user

Comments

@johndpope
Copy link

johndpope commented Apr 28, 2016

--- This code section failed: ---

102 0 LOAD_FAST 'locals'
3 STORE_LOCALS ''
4 LOAD_NAME 'name'
7 STORE_NAME 'module'
10 LOAD_CONST '_zone'
13 STORE_NAME 'qualname'

103 16 LOAD_NAME 'staticmethod'
19 LOAD_CONST '<code_object add_sim>'
22 LOAD_CONST '_zone.add_sim'
25 MAKE_FUNCTION_0 ''
28 CALL_FUNCTION_1 ''
31 STORE_NAME 'add_sim'

106 34 LOAD_NAME 'staticmethod'
37 LOAD_CONST '<code_object remove_sim>'
40 LOAD_CONST '_zone.remove_sim'
43 MAKE_FUNCTION_0 ''
46 CALL_FUNCTION_1 ''
49 STORE_NAME 'remove_sim'

Syntax error at or near `STORE_LOCALS' token at offset 3

These guys fixed this here zrax/pycdc#63 - I'll take a look.

@rocky
Copy link
Owner

rocky commented Apr 28, 2016

Let's set a little context here. As best as I can tell the opcode STORE_LOCALS was in python 3.0-3.3 but removed in 3.4 right? What version of Python does this bytecode come from?

If it is the case that this exists only in a limited number of Python 3 versions, some care is needed in crafting the deparse Python grammar so it exists only in those versions. I can help to ensure that; so not a big deal, but just something to note.

Harder though is taking something that works in https://github.com/zrax/pycdc and adapting that here. Underneath, sadly the two work totally differently and for things like this, uncompyle6 is the harder to adapt. pycdc seems to work more like an Python interpreter so adding an opcode independent of anything else is easier for it. Also pycdc keeps track of stack entries while uncompyle6 is doing a grammar derivation starting with disassembled bytecode as tokens.

What is needed and missing both here and in the pycdc bug report, is bytecode that reproduces this error. Even better we both would want minimal bytecode, that is the shortest example that shows the problem. Also it would be super to have the source code for that bytecode since obviously right now we can't get that from either program.

@johndpope
Copy link
Author

Hi Rocky, I managed to find some unpyc3 code that fully resolved all the pyo files to py files.
http://modthesims.info/showthread.php?t=532279&c=1&ht=&page=2&pp=25#startcomment

@rocky rocky added insufficient bug report The instructions given when opening a new issue are not followed Unresponsive user labels Dec 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
insufficient bug report The instructions given when opening a new issue are not followed Unresponsive user
Projects
None yet
Development

No branches or pull requests

2 participants