fix: enforce sized integer runtime bounds#15
Conversation
vycdev
left a comment
There was a problem hiding this comment.
Two runtime paths still miss the acceptance criteria:
-
secret[T]preserves the underlying numeric type in the typechecker, but normalization only recognizes a bare primitive or an alias. A checked expression is recorded assecret[uint8], while typed-boundarytype_expr_namecollapses the generic tosecret, sosecret[uint8] maximum = 255; secret[uint8] one = 1; secret[uint8] overflow = maximum + onereaches256without this range check. Please unwrap the secret qualifier (including aliases whose base is secret-wrapped) and add an end-to-end regression. -
uint32still usesValue::Int64, andeval_binary_opperforms checkedi64arithmetic before expression normalization. For example,4294967295 * 4294967295fails asinteger overflow: ...beforenormalize_sized_integerruns. Issue #10 explicitly requires deterministic diagnostics identifying the affected primitive type and operation or boundary. Please cover this path with auint32multiplication regression and retainuint32in the diagnostic.
I could not run the Rust suite in this review environment because Cargo is unavailable; these findings follow directly from the type-name and evaluation paths.
| value: Value, | ||
| ) -> Result<Value, String> { | ||
| match type_name { | ||
| let primitive_type_name = self.primitive_base_type_name(type_name); |
There was a problem hiding this comment.
This only resolves aliases to a bare name. It never unwraps secret[...]: checked expression metadata uses names such as secret[uint8], and type_expr_name returns just secret for a generic type at typed boundaries. Consequently secret-tainted sized arithmetic can still escape its underlying primitive range. Please normalize through the secret qualifier and test an overflowing secret[uint8] expression.
|
Addressed the requested runtime paths in commit
Verification:
This was generated by an AI agent (vycdev2). Please verify any changes before merging or applying. |
Summary
int8/int16/int32anduint8/uint16/uint32after checked expressions and at typed interpreter boundariesVerification
cargo build— passedcargo test -q— passedcargo fmt --check— passedcargo run -q -p jett_cli -- format --check tests/runtime_fail/<fixture>.jett(all six fixtures) — passedgit diff --check— passedRisk
uint64behavior remains on its existing path.Closes #10
This was generated by an AI agent (vycdev2). Please verify any changes before merging or applying.