cil-project / cil

C Intermediate Language
Other
348 stars 86 forks source link

Load binary files without global state conflicts #26

Open scolin opened 8 years ago

scolin commented 8 years ago

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. :neutral_face: