Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!zaphod.mps.ohio-state.edu!usc!ucsd!nosc!crash!ncr-sd!sagpd1!jharkins From: jharkins@sagpd1.UUCP (Jim Harkins) Newsgroups: comp.lang.c Subject: Re: Return Graph varies from Call Graph? Message-ID: <807@sagpd1.UUCP> Date: 6 Jun 90 20:03:58 GMT References: <1990Jun5.142836.9821@msuinfo.cl.msu.edu> Reply-To: jharkins@sagpd1.UUCP (Jim Harkins) Organization: Scientific Atlanta, Government Products Div, San Diego, CA Lines: 26 In article <1990Jun5.142836.9821@msuinfo.cl.msu.edu> reid@cpswh.cps.msu.edu (Dr Richard J. Reid) writes: >Do you have any suggestions about how to vary the >return graph of function invocation from the call graph? Lots of them, but this is a family newgroup :-) > Given the call sequence: A -> B -> C -> D > > Can the return sequence be: A <- C <- B <- D ? I don't really see why you would want to do this. If you did do it I think that, once maintanance is factored in, you're much better off coming up with a better algorithm for what you're trying to do. A slightly more palatable thing to do would be to change the return sequence to A <- B <- D (using your call sequence). Then all you do is figure out how many doo hickeys get put onto the stack when your C compiler does a function call (can you say 'implementation dependent'. I knew you could), then write some in-line assembly to adjust the stack pointer. Me? If I ended up maintaining code that did this sort of thing I'd look for a bucket of tar and some feathers. -- jim jharkins@sagpd1 I hate to see you go, but I love to see you walk away.