Open GoogleCodeExporter opened 9 years ago
Original comment by mcart...@cs.washington.edu
on 12 Mar 2015 at 9:31
Original comment by mcart...@cs.washington.edu
on 12 Mar 2015 at 9:31
Is this really specific to the Checker Framework?
From the description this sounds like:
https://bugs.openjdk.java.net/browse/JDK-8033803
Original comment by wdi...@gmail.com
on 12 Mar 2015 at 9:38
Hi Werner, Haoqing from UCLA (working for Jens Palsberg) reported this to us. I
was wonder if we could figure out a workaround for them so they can continue
with their work.
"But for our purpose of doing dynamic analysis combined with annotation, the
bug inhibits us from enabling dynamic cast check which will complement your
static checker."
I am trying to determine if there is an issue with the spec.
From the spec
"The value of the offset item specifies the code array offset of either the
bytecode instruction corresponding to the cast expression ..."
They intentionally didn't mention the checkcast bytecode (since it is not
always generated). His code does not insert a checkcast bytecode because the
types are the same.
Currently, the offset points to the first instruction in the cast, which seems
to correspond to the spec (offset 2 below):
class MyTest{
public int d;
public @Untainted int getSource(int input, @Tainted MyTest a){
int re = input;
int p = (@Untainted int) a.d;
return p;
}
public int getSource(int, MyTest);
Code:
0: iload_1
1: istore_3
2: aload_2 // cast offset here ?
3: getfield #10 // Field d:I
6: istore 4
8: iload 4
10: ireturn
However, is there any way to differentiate that from:
public @Untainted int getSource(int input, @Tainted MyTest a){
int re = input;
int p = ((@Untainted Mytest) a).d;
return p;
}
Code:
stack=1, locals=5, args_size=3
0: iload_1
1: istore_3
2: aload_2
3: getfield #2 // Field d:Ljava/lang/Object;
6: astore 4
8: return
Which will also point to an offset of 2.
Original comment by mcart...@cs.washington.edu
on 17 Mar 2015 at 9:27
Original issue reported on code.google.com by
mcart...@cs.washington.edu
on 12 Mar 2015 at 9:30Attachments: