Skip to content

Commit cff03d9

Browse files
Add validation for finite start, end, and interval
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 58c4aaa commit cff03d9

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎tensor/vector.zep‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,10 @@ class Vector implements Tensor
221221
. " when the end is greater than the start.");
222222
}
223223

224+
if unlikely !is_finite(start) || !is_finite(end) || !is_finite(interval) {
225+
throw new InvalidArgumentException("Start, end, and interval must be finite.");
226+
}
227+
224228
if unlikely start != end && abs(end - start) < abs(interval) {
225229
throw new InvalidArgumentException("Interval must be smaller"
226230
. " than the range spanned by the start and end.");

0 commit comments

Comments
 (0)