bugfixes July-26-2026 - #2207
Merged
Merged
Conversation
…write sites (#2191) addr(const_var) was rejected at the call site with E3122, but reading through a pointer to const is safe. Move the check to assignment sites so writes through the pointer (p^ = v, p^.field = v, p^ += v) are caught while reads are permitted. Track const origin via a new const_source flag on Symbol, following the existing is_ref pattern.
…_by_zero test_e2e_divide_by_zero manually incremented _test_pass/_test_fail instead of using ASSERT macros, causing RUN_TEST to double-count the result (100 passed, 0 failed with 99 total). Replace with ASSERT calls consistent with all other test functions. Also add total line to integration test runner summary.
…2177) Unbounded interpolation expressions could cause uncontrolled memory growth by allocating arbitrarily large strings on the arena. Add a size check before copying the expression text, emitting E2001 when the expression exceeds 64KB.
…ll bytes (#2195) Replace the two-pass gray_string_format approach in NODE_INTERPOLATED_STRING with chained gray_string_concat calls. gray_string_format uses vsnprintf which truncates at \0; gray_string_concat uses memcpy with explicit .len and is null-safe.
…inter dereference (#2164) Pointer assignment paths (p^, p^.field, p.inner.val, p.field) returned early with the raw C operator, skipping the overflow-checked compound assignment block. Add emit_checked_ptr_compound helper that emits gray_(u)sized_*_check / gray_(u)*_check for +=, -=, *= on integer types through all four pointer dereference paths.
…fix (#2162) Replace shallow ad-hoc checks with the existing assignment_target_root_name() helper so that deeply nested member/index chains (e.g. o.inner.value = 999, o.inner.value += 10, p.x++) are caught by the typechecker instead of leaking C compiler errors or silently violating const.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following changes:
Bug Fixes
gray_string_concatfor string interpolation to preserve null bytes (bug: string interpolation truncates at null bytes #2195)Security Improvments
Tests