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

PlException should not use PlRecordExternalCopy (or PlRecord) #41

Open
kamahen opened this issue Apr 13, 2023 · 1 comment
Open

PlException should not use PlRecordExternalCopy (or PlRecord) #41

kamahen opened this issue Apr 13, 2023 · 1 comment

Comments

@kamahen
Copy link
Member

kamahen commented Apr 13, 2023

There should be no need to use the "record" API for the error term.

However, there appear to be some corner cases with PlQuery that can create an error term that becomes invalid. It's possible that these are incorrect uses of PlQuery - if so, they should be caught in the PlQuery constructor or PlQuery::next_solution(). Another possibility is creating multiple kinds of PlQuery for the 4 (or 6) combinations of PL_Q_EXT_STATUS and PL_CATCH_EXCEPTION / PL_PASS_EXCEPTION / PL_Q_NORMAL - and we need test cases for all these combinations.

In the meantime, using PlRecordExternalCopy for the exception term is "safe" in the sense that it doesn't crash, but it also can consume large amounts of memory by copying the contents of the error term.

@kamahen
Copy link
Member Author

kamahen commented Apr 17, 2023

Also, the call to PlxErase() is only in PlException::plThrow() - it should also be in ~PlException after checking for non-null.

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