Skip to content

Load binary files without global state conflicts #26

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

scolin
Copy link
Contributor

@scolin scolin commented Apr 18, 2016

Hi,
this commit adds the ability to use loadBinaryFile at leisure, without having global state problems thereafter. The algorithm to do so is imho simple enough, without causing vid or ckey overflow if one is to save/reload the same file many times over several executions (the overflow problem could most probably arise realistically on 32bit OCaml, but I'd rather be cautious).

I did not add a test in the test suite, because cilly does not load/save binary files unfortunately. 😐

scolin added 2 commits April 14, 2016 20:08
This commit is in preparation to making the loading of several binary files
possible: for that visitCilFile is needed.
We add the ability to load several binary files at any moment, by inspecting
the binary file, computing a new mapping of its varinfo vid and compinfo
ckey fields so that they are compatible with the current nextGlobalVID and
nextCompinfoKey, and applying the mapping to the loaded file.
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 this pull request may close these issues.

1 participant