rocky / python-uncompyle6

A cross-version Python bytecode decompiler
GNU General Public License v3.0
3.79k stars 413 forks source link

Parse error at or near `LOAD_DICTCOMP' instruction at offset 36 #436

Closed oneoldfriend closed 1 year ago

oneoldfriend commented 1 year ago

the decompiled file header is like this:

# uncompyle6 version 3.9.0
# Python bytecode version base 3.7.0 (3394)
# Decompiled from: Python 3.7.15 (default, Nov 24 2022, 21:12:53) 
# [GCC 11.2.0]
# Embedded file name: src/hc_sim/PVD/device/LoadLock.py
# Compiled at: 2022-10-24 10:59:35
# Size of source mod 2**32: 7550 bytes

and during the decompiling process, i got the following error info:

--- This code section failed: ---

 L. 126         0  LOAD_GLOBAL              BaseStation
                2  LOAD_ATTR                __init__
                4  LOAD_DEREF               'self'
                6  LOAD_FAST                'env'
                8  LOAD_FAST                'module_name'
               10  LOAD_FAST                'module_type'
               12  LOAD_FAST                'capacity'
               14  LOAD_CONST               ('env', 'module_name', 'module_type', 'capacity')
               16  CALL_FUNCTION_KW_5     5  '5 total positional and keyword args'
               18  POP_TOP          

 L. 127        20  LOAD_FAST                'left_ll'
               22  LOAD_DEREF               'self'
               24  STORE_ATTR               left_ll

 L. 128        26  LOAD_FAST                'right_ll'
               28  LOAD_DEREF               'self'
               30  STORE_ATTR               right_ll

 L. 129        32  LOAD_CLOSURE             'self'
               34  BUILD_TUPLE_1         1 
               36  LOAD_DICTCOMP            '<code_object <dictcomp>>'
               38  LOAD_STR                 'LoadLockGroup.__init__.<locals>.<dictcomp>'
               40  MAKE_FUNCTION_8          'closure'

 L. 147        42  LOAD_FAST                'll_group'
               44  GET_ITER         
               46  CALL_FUNCTION_1       1  '1 positional argument'
               48  LOAD_DEREF               'self'
               50  STORE_ATTR               ll_group

 L. 149        52  SETUP_LOOP           82  'to 82'
               54  LOAD_FAST                'll_group'
               56  GET_ITER         
               58  FOR_ITER             80  'to 80'
               60  STORE_FAST               'll_name'

 L. 150        62  LOAD_DEREF               'self'
               64  LOAD_ATTR                ll_group
               66  LOAD_FAST                'll_name'
               68  BINARY_SUBSCR    
               70  LOAD_FAST                'env'
               72  LOAD_ATTR                elements
               74  LOAD_FAST                'll_name'
               76  STORE_SUBSCR     
               78  JUMP_BACK            58  'to 58'
               80  POP_BLOCK        
             82_0  COME_FROM_LOOP       52  '52'

Parse error at or near 'LOAD_DICTCOMP' instruction at offset 36

i don't know where it go wrong...

and i'm not sure what more info is needed, i'm very glad to add more info.

Thx ahead!

rocky commented 1 year ago

Attach the pyc file and src/hc_sim/PVD/device/LoadLock.py if you have that. And please look at https://github.com/rocky/python-uncompyle6/blob/master/.github/ISSUE_TEMPLATE/bug-report.md and https://github.com/rocky/python-uncompyle6/blob/master/HOW-TO-REPORT-A-BUG.md

oneoldfriend commented 1 year ago

sorry, the src file is not allowed for upload or any..... is there any other info that i can share with you? certain snippet?

rocky commented 1 year ago

Sorry - when you report an issue here, there is no privacy; and there should be no reason for privacy. In theory you should be stripping down the source code and bytecode to the smallest example that exhibits the problem. In that process anything confidential or personal can be removed or anonymized.

As stated elsewhere, we have a means of generating an unbounded number of decompilation problems where there is both the source code and bytecode, and often these are fairly isolated too.