Re: [CIL users] A problem about 'queueInstr'

2013-07-26 Thread Gabriel Kerneis
On Fri, Jul 26, 2013 at 09:39:26AM +0100, Gabriel Kerneis wrote: > I have no idea why and I don't have the time to check CIL code right now, but > using ChangeDoChildrenPost instead of DoChildren makes your code behave > correctly. I got it: this should be told explicitely in the doc, but the inte

Re: [CIL users] A problem about 'queueInstr'

2013-07-26 Thread Gabriel Kerneis
On Fri, Jul 26, 2013 at 03:46:51PM +0800, tsuletgo wrote: > Ok. i changed the code. > See the attached. Thanks. I have no idea why and I don't have the time to check CIL code right now, but using ChangeDoChildrenPost instead of DoChildren makes your code behave correctly: open Cil let function_i

Re: [CIL users] A problem about 'queueInstr'

2013-07-26 Thread Gabriel Kerneis
On Fri, Jul 26, 2013 at 03:35:34PM +0800, tsuletgo wrote: > Hi, Gabriel > I find some building error about your code snippet: > > method vfunc = function > > | GFun _ -> DoChildren > > | _ -> SkipChildren Hmm, vfunc should be vglob, sorry. -- Gabriel

Re: [CIL users] A problem about 'queueInstr'

2013-07-26 Thread tsuletgo
Hi, Gabriel I find some building error about your code snippet: > method vfunc = function > | GFun _ -> DoChildren > | _ -> SkipChildren The attached files are my code and my input file. The bug still occurs. Best! Ting From: Gabriel Kerneis Date: 2013-07-26 15:23 To: tsuletgo CC: cil-users S

Re: [CIL users] A problem about 'queueInstr'

2013-07-26 Thread Gabriel Kerneis
Oops, I didn't clean the code before sending it. It should have been: > class myVisitor = object(self) >inherit nopCilVisitor > >method vfunc = function >| GFun _ -> DoChildren >| _ -> SkipChildren > >method vstmt st = > let df_fun = Cil.emptyFunction "df_stmt_monitor"

Re: [CIL users] A problem about 'queueInstr'

2013-07-26 Thread Gabriel Kerneis
On Fri, Jul 26, 2013 at 11:07:42AM +0800, tsuletgo wrote: > Bug: Visitor's instruction queue is not empty. > You should only use queueInstr inside a function body! > Fatal error: exception Errormsg.Error > Could anyone give me some suggestions ? I'm not sure exactly why this fails, but I gu