Skip to content

Commit

Permalink
S529-023: Fix bug in get_doc check
Browse files Browse the repository at this point in the history
  • Loading branch information
raph-amiard authored and pmderodat committed Jun 10, 2019
1 parent f4ebb5f commit 44541fd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ada/extensions/src/libadalang-doc_utils.adb
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,11 @@ package body Libadalang.Doc_Utils is

-- Check that every character we're going to strip is a white
-- space; else, raise an error.
if not (for all C of L.Slice (1, Offset - 1) => Is_Space (C))
if not L.Is_Empty
and then
(Offset > L.Length
or else
not (for all C of L.Slice (1, Offset - 1) => Is_Space (C)))
then
raise Property_Error
with "Invalidly formatted documentation comment";
Expand Down

0 comments on commit 44541fd

Please sign in to comment.