[aspectc-user] pointers

Olaf Spinczyk Olaf.Spinczyk at informatik.uni-erlangen.de
Thu Jul 14 11:23:51 CEST 2005


Hi,

Jamal Siadat wrote:
> And for the Bug:
> 
> I may have acciedently discovered a bug! I have attached a couple of files
> that you may look at. The interesting thing is that if you change the
> before advice to an after advice in the aspect you'll get a segmentation
> fault when you run it!!!!!
> Oh and can anyone tell me how I can get away with using the after advice
> and being able to capture the arguments. As you can see I've tried 
> *tjp->arg<1>() as well but it doesn't seem to work.
> 
> 
> Thanks in advance,

computers start counting at 0 ;-).

This modified aspect works for me:

---
aspect Cache  {
pointcut calls()=  call("float dummy(...) ") && within ("% A::a(...)") ;
advice calls() :after (){

// cout << "b is "<< *tjp->arg<1>() <<endl;
cout << "in the advice b is "<< *tjp->arg<0>()  <<endl;
}
};
---

I suppose the problem was that you used the unsafe dynamic join point 
API to access an argument that did not exist. The result is 
undeterministic behavior.

Best regards,

Olaf



More information about the aspectc-user mailing list