http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60728
Bug ID: 60728 Summary: recover() should not work in recursive deferred fucntions Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: go Assignee: ian at airs dot com Reporter: vogt at linux dot vnet.ibm.com >From an email discussion between me and with Ian Lance Taylor about the function statements.cc:build_thunk(): Ian Lance Taylor wrote: > On Fri, Mar 28, 2014 at 3:37 AM, Dominik Vogt <v...@linux.vnet.ibm.com> wrote: > > (First note that I think there's a bug in the current code with > > recursive calls of functions with recover. Consider this: > > > > func f() { > > defer g(0); > > ... > > } > > > > func g(n int) { > > if n == 0 { > > g(1) > > } else { > > recover() > > } > > } > > > > With the current logic the recursive call of g() would recover > > (__go_gan_recover returns true), but it shouldn't because it's not > > called directly. The following sketch takes care of that > > situation.) > > Good point.