I would like to be able to call the pointer analysis multiple
times. Edits are below.
In ptranal.mli:
val initialize: unit -> unit
val analyze_global : Cil.global -> unit
In ptranal.ml:
let initialize (u:unit) = (
A.initialize ();
found_undefined := false;
current_fundec := None;
fun_varinfo_map := F.empty;
current_ret := None;
Hashtbl.clear lvalue_hash;
Hashtbl.clear expressions;
Hashtbl.clear lvalues;
all_globals := [];
all_functions := [];
count := 0;
)
In golf.mli:
val initialize : unit -> unit
In golf.ml:
let initialize (u:unit) = (
Q.clear eq_worklist;
Q.clear leq_worklist;
Q.clear path_worklist;
PH.clear path_hash;
toplev_count := 0;
H.clear cached_aliases;
H.clear join_cache;
)
I'm ok with the change in principle, but it also needs implementing for Of.
And count is hidden in fresh_index so cannot be reset directly like this. Do you actually use this change? Do you have a clean patch of it? I can work on it a bit, but I'm afraid to miss some globals to reset.
Yeah, I use it, but it hasn't been extensively tested, so I may
well have missed some globals.
I never used Olf, so I didn't add an initializer to it.
On Thu, Jun 26, 2014 at 2:03 PM, Gabriel Kerneis kerneis@users.sf.net
wrote:
--
sɐpıɯ ƃuıʞ ǝsɹǝʌuı
Related
Bugs: #145
Interesting:
( Hashtbl.clear fun_access_map; )
Clearly, at some point, I did, but commented it out. Not sure
why... /-: It looks like it doesn't matter - the table entries should be
defined before used.
On Thu, Jun 26, 2014 at 2:12 PM, az bro azbro@users.sf.net wrote:
--
sɐpıɯ ƃuıʞ ǝsɹǝʌuı
Related
Bugs: #145
On Thu, Jun 26, 2014 at 11:28:40AM +0000, az bro wrote:
Ack. I'll reset nonetheless.
One more question: you are resetting count in Ptranal but not
appsite_index, counter and stamp in Golf.ml. Is this on purpose?
I'll then try and write initialize for Olf and push the change, it looks
good.
No, didn;'t even notice them since they're declared inside
functions... They should be reset too, of course. Again,
won't matter.
Thanks!
C
On Thu, Jun 26, 2014 at 2:34 PM, Gabriel Kerneis kerneis@users.sf.net
wrote:
--
sɐpıɯ ƃuıʞ ǝsɹǝʌuı
Related
Bugs: #145
In ptranal.ml, why don't you clear fun_access_map too?
OK, tentative patches pushed to branch ptanal-fixes. Let me know if it works for you. Thanks for the report.