Visitar URL original
arm: fix runtime ARM/Thumb mode switching by raaller · Pull Request #3164 · capstone-engine/capstone · GitHub
Skip to content

arm: fix runtime ARM/Thumb mode switching - #3164

Open
raaller wants to merge 1 commit into
capstone-engine:nextfrom
raaller:fix/arm-mode-switch-3162
Open

raaller wants to merge 1 commit into
capstone-engine:nextfrom
raaller:fix/arm-mode-switch-3162

Conversation

@raaller

@raaller raaller commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Your checklist for this pull request

  • I've documented or updated the documentation of every API function and struct this PR changes.
  • I've added tests that prove my fix is effective or that my feature works (if possible)

Detailed description

Switching back to atm with CS_OPT_MODE left the thumb bit set, so the handle continued decoding in thumb mode. Replace the mode flags, clear pending IT/VPT state when the mode changes, and refresh the default skip size for CS_OPT_SKIPDATA.

Test plan

Added a regression test that switches between arm and thumb on the same handle and checks decoding, skip sizes

Closing issues

Closes #3162

@github-actions github-actions Bot added ARM Arch CS-core-files auto-sync labels Nov 11, 2026
@codecov

codecov Bot commented Nov 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 48.38710% with 16 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (next@823242a). Learn more about missing BASE report.

Files with missing lines Patch % Lines
tests/unit/api.c 34.78% 9 Missing and 6 partials ⚠️
cs.c 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             next    #3164   +/-   ##
=======================================
  Coverage        ?   61.47%           
=======================================
  Files           ?      243           
  Lines           ?    56858           
  Branches        ?    10092           
=======================================
  Hits            ?    34956           
  Misses          ?    16701           
  Partials        ?     5201           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ARM Arch CS-core-files auto-sync

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ARM] CS_OPT_MODE returns CS_ERR_OK but fails to switch from Thumb back to ARM

1 participant