typetools / checker-framework

Pluggable type-checking for Java
http://checkerframework.org/
Other
1.02k stars 355 forks source link

@Untainted multiplied by a constant should be @Untainted #394

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Currently an @Untainted int multiplied by a constant is @Tainted, e.g.
"z" below is currently @Tainted

void test(@Untainted int x) {
    y = x * 10;
    String z = "test" + y;
}

Original issue reported on code.google.com by trask.st...@gmail.com on 28 Jan 2015 at 3:39

mernst commented 6 years ago

Here is a compilable version of the test case:

import org.checkerframework.checker.tainting.qual.*;

class TaintingTest {

  void test(@Untainted int x) {
    @Untainted int y = x * 10;
    @Untainted String z = "test" + y;
  }
}