`localopts': handle recursive macro calls..
commit25caeb903be133e723d5cfe4894cc7fbf732802f
authorSteffen (Daode) Nurpmeso <sdaoden@users.sf.net>
Thu, 12 Jun 2014 16:21:22 +0000 (12 18:21 +0200)
committerSteffen (Daode) Nurpmeso <sdaoden@users.sf.net>
Thu, 12 Jun 2014 16:42:55 +0000 (12 18:42 +0200)
tree3756678912396d75b8727b165b7fb45efe2281fb
parent88c9d8e4d1ed4617489fd4a84d931f15ff24edd6
`localopts': handle recursive macro calls..

After a long server hang during a recursive macro call and
multiple manual interrupts i got a `localopts' crash ... when
calling the macro again.  Reproducable via

  set header
  define t0 {
     call t1
     #var t1 t2 t3
  }
  define t1 {
     localopts 1
     set hold noheader t1
     echo t1.in
     call t2
     echo t1.out
     #var t1 t2 t3
  }
  define t2 {
     echo t2.in
     set t2
     call t3
     echo t2.out
  }
  define t3 {
     echo t3.in
     set t3
  # debug command: called kill(getpid(), SIGINT)
     du
  # ok: !kill -INT $$
     echo t3.out
  }

  # ...

  ? ~t0
  ? ~t0

Beside not dealing with recursion our temporary_localopts_store
hack (which tries to circumvent that the signal-manager is yet not
implemented) also did not do _localopts=NULL, which was the actual
cause of the crash since temporary_localopts_store uses that
value, so the dangling thing of before the interruption will
survive.
acmava.c