Skip to content

reject noninteger array dimensions - #171

Closed
kisnner26 wants to merge 1 commit into
fox-it:mainfrom
kisnner26:fix/noninteger-array-dimensions
Closed

kisnner26 wants to merge 1 commit into
fox-it:mainfrom
kisnner26:fix/noninteger-array-dimensions

Conversation

@kisnner26

Copy link
Copy Markdown

fixes #163.

array dimensions currently suppress expression evaluation errors, so a constant containing text becomes a dynamic array size and fails only when reading data. propagate integer conversion failures as parser errors while preserving unresolved field expressions.

adds 12 regression cases covering invalid string/bytes constants, integer constants (including zero), and field-dependent lengths in compiled and interpreted mode. the six invalid-constant cases fail before the change.

validation: 121 parser/expression tests pass; ruff 0.13.1 lint and formatting, python 3.10 compatibility check, and git diff --check pass.

@Schamper
Schamper requested a review from Miauwkeru October 27, 2026 09:21
@codecov

codecov Bot commented Oct 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (46b850f) to head (e9b89f6).

Files with missing lines Patch % Lines
dissect/cstruct/parser.py 0.00% 3 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main    #171   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files         22      22           
  Lines       2854    2855    +1     
=====================================
- Misses      2854    2855    +1     
Flag Coverage Δ
unittests 0.00% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@codspeed

codspeed Bot commented Oct 27, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 14 untouched benchmarks


Comparing kisnner26:fix/noninteger-array-dimensions (e9b89f6) with main (46b850f)

Open in CodSpeed

@Miauwkeru

Copy link
Copy Markdown
Contributor

I'll take a look once the CLA on fox-it/dissect.util#142 is accepted

@Schamper

Schamper commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Surpassed by #184.

@Schamper Schamper closed this Nov 5, 2026
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.

Add validation for array expressions

3 participants