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

Missing return statement(s) in Set_Default_Target? #121

Open
dvraaij opened this issue Nov 13, 2022 · 0 comments
Open

Missing return statement(s) in Set_Default_Target? #121

dvraaij opened this issue Nov 13, 2022 · 0 comments

Comments

@dvraaij
Copy link

dvraaij commented Nov 13, 2022

While debugging some other problem, I noticed that exceptions are being raised from within Set_Default_Target in libgpr. After reading the code, I was left wondering whether some return statements are missing near line 58 and line 64 in gpr-sdefault.adb.

Near line 64 in particular, without the return statement, the execution of the procedure continues when file default_target is found not to be a regular file (so likely to be non-existing, although there might still be a symbolic link, I guess).

In my case, the file does not exists. This leads to an exception being raised from Ada.Text_IO.Open near line 67, which subsequently crashes the overall program as the traceback generator (invoked as part of the exception information inquiry in the exception handler) raises another exception; the problem I was actually looking into but is outside the scope of this ticket.

Note that my interpretation of the code might be wrong here. I'm not intimately familiar with the intend of the code, but I thought the observation might be of interest.

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

No branches or pull requests

1 participant