{"record":{"id":"6f580160ad29dd53","repo":"biomejs/biome","slug":"integer-overflow","errorCode":null,"errorMessage":"integer overflow","messagePattern":"integer overflow","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/biome_diagnostics/src/location.rs","lineNumber":300,"sourceCode":"    fn as_span(&self) -> Option<TextRange> {\n        T::as_span(*self)\n    }\n}\n\nimpl AsSpan for TextRange {\n    fn as_span(&self) -> Option<TextRange> {\n        Some(*self)\n    }\n}\n\nimpl<T: Copy> AsSpan for Range<T>\nwhere\n    TextSize: TryFrom<T>,\n    <TextSize as TryFrom<T>>::Error: Debug,\n{\n    fn as_span(&self) -> Option<TextRange> {\n        Some(TextRange::new(\n            TextSize::try_from(self.start).expect(\"integer overflow\"),\n            TextSize::try_from(self.end).expect(\"integer overflow\"),\n        ))\n    }\n}\n\n/// Utility trait for types that can be converted into [SourceCode]\npub trait AsSourceCode {\n    fn as_source_code(&self) -> Option<BorrowedSourceCode<'_>>;\n}\n\nimpl<T: AsSourceCode> AsSourceCode for Option<T> {\n    fn as_source_code(&self) -> Option<BorrowedSourceCode<'_>> {\n        self.as_ref().and_then(T::as_source_code)\n    }\n}\n\nimpl<T: AsSourceCode> AsSourceCode for Box<T> {\n    fn as_source_code(&self) -> Option<BorrowedSourceCode<'_>> {","sourceCodeStart":282,"sourceCodeEnd":318,"githubUrl":"https://github.com/biomejs/biome/blob/405dedb0ff65dd29927faf587f6542e3c29db248/crates/biome_diagnostics/src/location.rs#L282-L318","documentation":"Error \"integer overflow\" thrown in biomejs/biome.","triggerScenarios":"Thrown at crates/biome_diagnostics/src/location.rs:300 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure byte offsets used for diagnostics fall within the source text length.","Guard location conversions with checked arithmetic when offsets come from untrusted input."],"exampleFix":"let offset = TextSize::try_from(u64_value).map_err(|_| io::Error::new(ErrorKind::InvalidInput, \"integer overflow\"))?;","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"405dedb0ff65dd29927faf587f6542e3c29db248","analyzedAt":"2026-08-20T00:25:09.682Z","contentChangedAt":"2026-08-20T00:25:09.682Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}