mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-04 20:31:11 +00:00
Improves documentation, and adding DocC (#6784)
Finished documenting flatbuffersbuilder Replaces swift 5.5 with 5.2 packages Starts building the tutorial for xcode 13 Finishes building the tutorial for xcode 13 Removes docc files from old swift versions Updates swift style guide
This commit is contained in:
@@ -176,14 +176,18 @@ public struct Verifier {
|
||||
|
||||
let reportedOverflow: (partialValue: UInt32, overflow: Bool)
|
||||
if offset > 0 {
|
||||
reportedOverflow = _int32Position.subtractingReportingOverflow(offset.magnitude)
|
||||
reportedOverflow = _int32Position
|
||||
.subtractingReportingOverflow(offset.magnitude)
|
||||
} else {
|
||||
reportedOverflow = _int32Position.addingReportingOverflow(offset.magnitude)
|
||||
reportedOverflow = _int32Position
|
||||
.addingReportingOverflow(offset.magnitude)
|
||||
}
|
||||
|
||||
/// since `subtractingReportingOverflow` & `addingReportingOverflow` returns true,
|
||||
/// if there is overflow we return failure
|
||||
if reportedOverflow.overflow || reportedOverflow.partialValue > _buffer.capacity {
|
||||
if reportedOverflow.overflow || reportedOverflow.partialValue > _buffer
|
||||
.capacity
|
||||
{
|
||||
throw FlatbuffersErrors.signedOffsetOutOfBounds(
|
||||
offset: Int(offset),
|
||||
position: position)
|
||||
|
||||
Reference in New Issue
Block a user