Skip to content

Conversation

@jepler
Copy link
Contributor

@jepler jepler commented Jun 15, 2025

Summary

In the case of viper code it's possible to reach MP_ASM_PASS_EMIT with a code size of 0 bytes. Update the assertion accordingly.

After this change, `mpy-cross -march=debug' on the viper tests creates output that looks plausible to me, though I am not experienced in reading the output.

Closes: #17467

Testing

I locally ran mpy-cross on some viper files.

Trade-offs and Alternatives

As this just changes an assertion it's unlikely to affect real ports.

I briefly considered that the code size could also be forced non-zero but this would add code and doesn't appear to be necessary. Or, that the debug backend emitter could set its own length, but this does not seem to be necessary.

In the case of viper code it's possible to reach MP_ASM_PASS_EMIT
with a code size of 0 bytes. Update the assertion accordingly.

After this change, `mpy-cross -march=debug' on the viper tests creates
output that looks plausible to me, though I am not experienced in
reading the output.

Signed-off-by: Jeff Epler <jepler@gmail.com>
Closes: micropython#17467
@codecov
Copy link

codecov bot commented Jun 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.54%. Comparing base (398da22) to head (b7df9d1).
Report is 9 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #17499   +/-   ##
=======================================
  Coverage   98.54%   98.54%           
=======================================
  Files         169      169           
  Lines       21946    21946           
=======================================
  Hits        21626    21626           
  Misses        320      320           

☔ View full report in Codecov by Sentry.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dpgeorge dpgeorge added the py-core Relates to py/ directory in source label Jun 15, 2025
@dpgeorge
Copy link
Member

Rebased and merged in 5ff2ae5

@dpgeorge dpgeorge closed this Jun 16, 2025
@jepler jepler deleted the mpy-cross-debug-crash branch June 16, 2025 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

py-core Relates to py/ directory in source

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mpy-cross: Assertion failed for -march=debug and Viper code

2 participants