• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

neo-project / neo-devpack-dotnet / 21466640846

29 Jan 2026 05:19AM UTC coverage: 74.122% (-0.06%) from 74.179%
21466640846

push

github

web-flow
fix(compiler): add left shift overflow check in checked context (#1486)

* fix(compiler): add left shift overflow check in checked context

- Add CheckShiftOverflow method to validate shift amount
- Prevent unexpectedly large values from left shift operations
- Runtime check throws if shift amount exceeds type bit width

Fixes HIGH-001 from compiler security audit

* fix: call CheckShiftOverflow for left shift operator in checked context

- Add call to CheckShiftOverflow when processing '<<' operator
- Add checked context guard in CheckShiftOverflow method

Addresses review comment: https://github.com/neo-project/neo-devpack-dotnet/pull/1486#discussion_r2732283515

* fix: treat BigInteger as Int256 (256-bit) for shift overflow check

In NEO, BigInteger is Int256, not unlimited precision.
Updated maxShift from -1 (no limit) to 256 bits.

6108 of 9027 branches covered (67.66%)

Branch coverage included in aggregate %.

39 of 48 new or added lines in 2 files covered. (81.25%)

15850 of 20597 relevant lines covered (76.95%)

21509.59 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

78.41
/src/Neo.Compiler.CSharp/MethodConvert/Expression/BinaryExpression.cs


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc