[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-dev] Potential bug: Problem with switch statement


Hi,

I've just spent the morning looking at bug 39479 - which is to do with inlining constructors that contain switch statements.  I've fixed it - and then saw this note which talks about advice that contains switch statements - I think the code below demonstrates another case of the same bcel bug.  It is to do with Select instructions not supporting copy() correctly.  I've created a patch for the problem and verified it fixes the problem that appears when compiling the sample code below - and the patch doesn't cause any of the existing tests to fail.  Basically, wherever there is a bcel instruction copy() we have to check if its a Select instruction and do something special, until BCEL is fixed.

Have you raised a bugzilla report for it Charles? So I can attach the patch to it?

regards,
- Andy.



Wes Isberg <wes@xxxxxxxxxxxxxx>
Sent by: aspectj-users-admin@xxxxxxxxxxx

15/07/2003 07:02
Please respond to aspectj-users

       
        To:        aspectj-users@xxxxxxxxxxx
        cc:        
        Subject:        Re: [aspectj-users] Potential bug: Problem with switch statement



Thanks - would you enter this to the bug database?

Wes

Charles Zhang wrote:

> Hi, AspectJ hackers, here is what I got tonight as a reproducable error.
> Sorry, I searched a bit of the bugzilla but couldn't find anything
> similar. It has something to do with a switch statement in the aspect
> code. Thanks for any information.
>
> To re-produce, compile the following on ajc1.1, ajc1.0, however, is OK.
> Test.java
> public class Test {
>                  public String method1(){
>                                   System.out.println("method1");
>                                   return "method1";
>                  }
>                  
>                  
>                  
>                  public static void  main(String [] args)
>                  {
>                                   System.out.println(new Test().method1());
>                  }
> }
>
> ===========TestAspect.java================
> String around(Test t):target(t)&&
>                  call(public String method1())
>                  {
>                                   int flag = 1;
>                                   switch(flag)
>                                   {
>                                                    case 1:
>                                   }
>                                   return null;
>                  }
>
>
> C:\eclipse\workspace\Test>c:\aspectj1.1\bin\ajc *.java > out
> trouble in:
> public class Test extends java.lang.Object:

> -------8<  SNIP  8<------------
>
> Charles Zhang                                   (http://www.eecg.utoronto.ca/~czhang)
> Computer Group, Dept. of Elec. & Comp. Engineering
> U. of Toronto, Ontario, Canada
> *********************************************************
> " Yawn!!" (Charles Zhang)
>
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aspectj-users
>