-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[v5] python: Fix definition of capstone syntax value option constants #2240
Conversation
@kabeor Be so kind and trigger the CI. |
On a second look. I think it is better if the enum in Besides, in Would you agree? |
This is still the aftermath of #2097 getting backported completely into v5 while the second commit wasn't supposed to be backported since it aligns the Python bindings with the new constant values introduced with the ARM auto-sync merge. There are several issues mentioning this #2145 #2144 and I've explained this here #2145 (comment) It seems the commit was never reverted, so this PR should revert more than only the SYNTAX constants to clean it up. Changing such definitions in the core in minor version updates might cause trouble with other bindings, so I'd advocate to only fix the Python bindings and wait until v6 to change them. |
So how do we get this fixed? Do you want me to update this PR to revert more of 53eaeac? Should I just revert all changes to the |
On a shallow look (sorry, don't have too much time currently) reverting commit 2ed0906 is the way to go. @peace-maker Can you confirm? |
The ARM auto-sync merge was not supposed to be backported to the v5 branch but was accidentally backported. For more information refer to: #2240 (comment) This reverts part of commit 53eaeac.
Just went ahead and updated the PR. |
@kabeor Please trigger the workflows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. @peace-maker any more comments?
Ready to merge or do you need me to do anything else? |
Looks good, thank you! |
[ commit 6a797fd5e1abc0cfb2443b809925467b9f046e52 ] See: capstone-engine/capstone#2240
Are there any plans on releasing a new version with this fix? |
Will be part of |
The option values for capstone syntax bindings are currently out-of-sync with capstone.h on the v5 branch.
This causes Python code using the syntax options to not work correctly. For example, consider:
This code will presently error on the latest 5.0.1 release, it works on both the next branch and the 4.X releases.
The error message is:
This is because commit 53eaeac broke the option values on the v5 branch as it caused
capstone.h
andbindings/python/capstone/__init__.py
to define these values differently.Compare
capstone/include/capstone/capstone.h
Lines 216 to 226 in 16e2b9f
with
capstone/bindings/python/capstone/__init__.py
Lines 338 to 345 in 16e2b9f
This was discovered while debugging an angr test failure with Capstone 5.0.1.