-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Z3]: apigen.py: move call to
#errorCheck
right after a call to Z3
During debugging of weird failure in `Z3CAPITest >> testEnum` we realized that the call to Z3 failed but did not fail in `#errorCheck` as one would expect. Instead, the code failed trying to extract value from output parameter (which was luckily NULL!). This is because call to `#errorCheck` was made too late, after extracting and freeing output parameters. The correct thing is to call `#errorCheck` right after the call to Z3 API. However, this is not that simple! If there are array arguments, we have to free them in ensure (otherwise we'd leak them). To make it more complicated, some arrays are out or in/out parameters, so we have to extract the value after # errorCheck but NOT in #ensure: block in case call fails. Yet another 'complication' comes from the fact, that few Z3 API do not require error check (have no context) but use out and/or in/out parameters. This commit updates `apigen.py` so it generates ensure when needed and updates code in class `Z3` accordingly.
- Loading branch information
Showing
2 changed files
with
559 additions
and
313 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.