Skip to content

fix(template_helpers) :: stop plus and minus from overflowing on large integers - #1412

Open
81reap wants to merge 2 commits into
sqlpage:mainfrom
81reap:mutation/04-template-helper-overflow
Open

fix(template_helpers) :: stop plus and minus from overflowing on large integers#1412
81reap wants to merge 2 commits into
sqlpage:mainfrom
81reap:mutation/04-template-helper-overflow

Conversation

@81reap

@81reap 81reap commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Both helpers did unchecked i64 math, so large numbers panicked the renter in debug or silently overflowed in release. Now helpers fall back to floating point.

@81reap
81reap marked this pull request as draft August 31, 2026 20:18
@81reap
81reap marked this pull request as ready for review August 31, 2026 20:22

@lovasoa lovasoa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally one pr should address one specific point. If the stated goal is to fix a bug in one particular edge case, then add a test for that particular edge case.

Comment thread CHANGELOG.md Outdated
Comment thread src/template_helpers.rs
ScopedJson::Context(value, vec![path.to_string()])
}

mod documented_helpers {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

most of these already passed before, right ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, only prod fails on integer_arithmetic_falls_back_to_floats_instead_of_overflowing which also handles

If the stated goal is to fix a bug in one particular edge case, then add a test for that particular edge case.

…e integers

Both helpers did unchecked i64 math, so large numbers paniced the renter in debug or silently overflowed in release. Now helpers fall back to floating point.

Also removes unused H0 helper type.
@81reap
81reap force-pushed the mutation/04-template-helper-overflow branch from 4e4c226 to 9727a21 Compare September 1, 2026 23:49
@81reap

81reap commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Ideally one pr should address one specific point.

the h0 change seemed too small to PR on it's own and didn't really fit into the stack. I raised it as a separate fix here #1419

@81reap
81reap requested a review from lovasoa September 1, 2026 23:53
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.

2 participants