As a side effect of making a copy of a function using
CopyFunction, the statement IDs of the original function
are changed. This should either be fixed, or a note should
be added to the documentation.
method vstmt (s: stmt) : stmt visitAction =
s.sid <- !sid; incr sid;
let s' = {s with sid = s.sid} in
This seems a feature rather than a bug to me. I've updated the documentation to mention the allocation of fresh sids.
OK, makes sense.
On Tue, May 27, 2014 at 6:11 PM, Gabriel Kerneis kerneis@users.sf.netwrote:
--
sɐpıɯ ƃuıʞ ǝsɹǝʌuı
Related
Bugs: #143
No, in fact it makes no sense… Sids must be fresh within a single function. There is no reason in principle to break them. However, notice that stmt.preds and stmt.succs are going to be broken anyway - pointing to the old statements. So I guess the right thing to do is to reset everything (sid = -1, preds = succs = []), and force recomputation of the CFG?
I'll commit this if it makes sense.
Ha, the code abuses the sid to index the hashtable! This is horrible. Oh my... It should use the statements themselves, with physical equality. I did not realize that it resets the original sids... Oh...
I'll fix that. The new behaviour will be:
There is a patch proposal in branch fix-copyfunction. Could you tell me if it solves your issue (as well as #142)? Thanks a lot.