Skip to content

parsenum: Fix parsing LLONG_MIN. #17933

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jepler
Copy link
Contributor

@jepler jepler commented Aug 15, 2025

Summary

Re-organize mp_parse_num_integer (for longlong) slightly so that the most negative 64-bit integer can be parsed.

Closes #17932.

Testing

I ran the longlong testsuite locally.

Trade-offs and Alternatives

Closes micropython#17932.

Signed-off-by: Jeff Epler <jepler@gmail.com>
Copy link

codecov bot commented Aug 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.38%. Comparing base (b7cfafc) to head (3a8b57e).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #17933   +/-   ##
=======================================
  Coverage   98.38%   98.38%           
=======================================
  Files         171      171           
  Lines       22297    22297           
=======================================
  Hits        21938    21938           
  Misses        359      359           

☔ 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.

Copy link

Code size report:

   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:    +0 +0.000% standard
      stm32:    +0 +0.000% PYBV10
     mimxrt:    +0 +0.000% TEENSY40
        rp2:    +0 +0.000% RPI_PICO_W
       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS
  qemu rv32:    +0 +0.000% VIRT_RV32

@jepler
Copy link
Contributor Author

jepler commented Aug 15, 2025

This almost certainly grows code size, but no longlong builds are in the size check(afaik). Locally, I see 52 bytes of growth on x86_64 linux:

   text	   data	    bss	    dec	    hex	filename
   2201	      0	      0	   2201	    899	build-longlong/py/parsenum.o~master
   2253	      0	      0	   2253	    8cd	build-longlong/py/parsenum.o~pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

in longlong build, can't directly write the constant -9223372036854775808
1 participant