Conversation
|
This may improve this situation but make other situations worse. So it may be that tests on both the bytecode version and Python version may need to be done. Also, we might want to jigger things in xdis rather than here. Let me think about this one. |
|
In thinking more about this, I think the change is more appropriately made in xdis, not here. The order that set items should appear is the order in which they items appear in marshal data. Since Python 3.1, there is OrderedDict. And that is what should be used for those versions of Python that support this. |
I agree, however, is there a way to parse the value in xdis and store it like some other type, in this case |
Yes, this would all be done inside xdis. |
0a143a1 to
78eeca4
Compare
|
@olii the current xdis unmarshal routine now attempts to preserve the ordering given by the lists in that form dictionaries and sets. Please try out with the current xdis master and current uncomplyle6 master and let me know where we are still failing. |
This PR attempts to fix the decompilation of simple sets defined as
LOAD_CONST. Sets were decompiled correctly but the order of elements was not defined.Test input
This was my test input compiled by the Python 3.6:
Disassembly
Decompilation outputs before patch
Attempt n. 1:
Attempt n. 2:
Decompilation output after patch