Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gnattest: Utils.Drivers.Driver.Process_Files: logic bug with ignored switch #25

Open
kilian-gebhardt opened this issue Jun 5, 2023 · 0 comments · May be fixed by #27
Open

gnattest: Utils.Drivers.Driver.Process_Files: logic bug with ignored switch #25

kilian-gebhardt opened this issue Jun 5, 2023 · 0 comments · May be fixed by #27

Comments

@kilian-gebhardt
Copy link

I hit the pragma Assert (Counter = 0); in https://github.com/AdaCore/libadalang-tools/blob/263158611cf1b073db6733a9aa247c3a16f086d3/src/utils-drivers.adb#LL128C11-L128C38
when invoking gnattest with one ignore file that contained more than 1 file name (say 5).

The issue is that Arg_Length (Cmd, Ignore) only provides the number of ignore files but not the actual number of file names in those ignore files:

N_File_Names : constant Natural := Num_File_Names (Cmd) - Arg_Length (Cmd, Ignore);
Counter        : Natural := N_File_Names;

Counter subsequently get's decremented on every non-ignored file. Since Counter = N_File_Names - 1, Counter = 4 when the assertion is hit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant