Successive calls of Cil.emptyfunction generate a Failure("trying to redefine an existing kernel function")
ID0000831: This issue was created automatically from Mantis Issue 831. Further discussion may take place here.
|no change required
|Fixed in Version
Cil.emptyFunction relies on makeGlobalVar, that calls makeVarinfo to build a new varinfo. This varinfo has vid = -1, but the function set_vid from Cil_const is called that provides a fresh vid to it, using the Build_Counter (register with Computation.Ref).
The issue is the following: working in a project, I introduce a new function when applying a cil copy visitor. Then on the new project I introduce another new function. The problem is that the two successive calls to Cil.emptyfunction will provide the same vid.
The project created through the cil copy visitor will not keep the Computation.Ref Build_Counter. So the successive introductions of new function will be associated to the same vid.
Is there a way do solve this ? How to copy the Build_Counter information in the new project ? Or is there nicer way to handle this ?