Repository: soot-oss/soot

Issue #198: Exception syas: 'local type not allowed in final code'  when analasis a directory to get cfg
Created: 2014-04-26T16:26:17Z
Hello!
I've got the exceptions like :
local type not allowed in final code: null_type
local type not allowed in final code: bottom_type
when transforming the jimple files and getting the cfg of some programs, i.e. the package in DaCapo 2009 of  avrora-cvs-20091224, antlr-3.1.3, eclipse, and so on ( I unpacked the corresponding program, and analasy the directory.)
Take antlr-3.1.3 for example.
/I used soot by the follow code/
/mysoot.java/
import java.util.Map;
import soot.Body;
import soot.BodyTransformer;
import soot.PackManager;
import soot.Transform;
class myprinter extends BodyTransformer {
/fot testing, do nothing/
protected void internalTransform(Body body, String string, Map map) {  }
}
public class mysoot {
    public static void main(String[] args){  

        myprinter printer = new myprinter();  
        Transform t1 = new Transform("jtp.myPrinter", printer);  

        soot.options.Options.v().set_keep_line_number(true);
        soot.options.Options.v().set_allow_phantom_refs(true);                  
        soot.options.Options.v().set_verbose(false);

        PackManager.v().getPack("jtp").add(t1);  

        String[] soot_args = new String[5];  
        soot_args[0] = "-process-dir";  
        soot_args[1] = args[0];
        soot_args[2] ="-cp";
        soot_args[3] =args[0];
        soot_args[4] = "-pp";           
        soot.Main.main(soot_args);  
      }  

}
with the command:
javac mysoot.java
java mysoot antlr-3.1.3
I've gotten the exception:
Exception in thread "main" java.lang.RuntimeException: (<org.antlr.stringtemplate.PathGroupLoader: org.antlr.stringtemplate.StringTemplateGr
oup loadGroup(java.lang.String,java.lang.Class,org.antlr.stringtemplate.StringTemplateGroup)>) local type not allowed in final code: null_ty
pe local: n1 body:
public org.antlr.stringtemplate.StringTemplateGroup loadGroup(java.lang.String, java.lang.Class, org.antlr.stringtemplate.StringTemplate
Group)
{...}
}
   at soot.jimple.JimpleBody.validateTypes(JimpleBody.java:97)
   at soot.jimple.JimpleBody.validate(JimpleBody.java:73)
   at soot.baf.BafBody.<init>(BafBody.java:66)
   at soot.baf.Baf.newBody(Baf.java:560)
   at soot.PackManager.convertJimpleBodyToBaf(PackManager.java:956)
   at soot.PackManager.runBodyPacks(PackManager.java:916)
   at soot.PackManager.runBodyPacks(PackManager.java:584)
   at soot.PackManager.runBodyPacks(PackManager.java:487)
   at soot.PackManager.runPacksNormally(PackManager.java:464)
   at soot.PackManager.runPacks(PackManager.java:388)
   at soot.Main.run(Main.java:203)
   at soot.Main.main(Main.java:146)
   at mysoot.main(mysoot.java:33)

I've tried both the stable and nightly version of Soot.

Duplicate issue #199: Exception syas: 'local type not allowed in final code'  when analasis a directory to get cfg
Created: 2014-04-26T16:29:40Z
Hello!
I've got the exceptions like :
local type not allowed in final code: null_type
local type not allowed in final code: bottom_type
when transforming the jimple files and getting the cfg of some programs, i.e. the package in DaCapo 2009 of  avrora-cvs-20091224, antlr-3.1.3, eclipse, and so on ( I unpacked the corresponding program, and analasy the directory.)
Take antlr-3.1.3 for example.
/I used soot by the follow code/
/mysoot.java/
import java.util.Map;
import soot.Body;
import soot.BodyTransformer;
import soot.PackManager;
import soot.Transform;
class myprinter extends BodyTransformer {
/for testing, do nothing/
protected void internalTransform(Body body, String string, Map map) {  }
}
public class mysoot {
public static void main(String[] args){
myprinter printer = new myprinter();
Transform t1 = new Transform("jtp.myPrinter", printer);
soot.options.Options.v().set_keep_line_number(true);
soot.options.Options.v().set_allow_phantom_refs(true);
soot.options.Options.v().set_verbose(false);
PackManager.v().getPack("jtp").add(t1);
        String[] soot_args = new String[5];  
        soot_args[0] = "-process-dir";  
        soot_args[1] = args[0];
        soot_args[2] ="-cp";
        soot_args[3] =args[0];
        soot_args[4] = "-pp";           
        soot.Main.main(soot_args);  
      }  

}
with the command:
javac mysoot.java
java mysoot antlr-3.1.3
I've gotten the exception:
Exception in thread "main" java.lang.RuntimeException:(<org.antlr.stringtemplate.PathGroupLoader:org.antlr.stringtemplate.StringTemplateGroup loadGroup(java.lang.String,java.lang.Class,org.antlr.stringtemplate.StringTemplateGroup)>) local type not allowed in final code: null_type local: n1 body:
public org.antlr.stringtemplate.StringTemplateGroup loadGroup(java.lang.String, java.lang.Class, org.antlr.stringtemplate.StringTemplate
Group)
{...}
at soot.jimple.JimpleBody.validateTypes(JimpleBody.java:97)
at soot.jimple.JimpleBody.validate(JimpleBody.java:73)
at soot.baf.BafBody.(BafBody.java:66)
at soot.baf.Baf.newBody(Baf.java:560)
at soot.PackManager.convertJimpleBodyToBaf(PackManager.java:956)
at soot.PackManager.runBodyPacks(PackManager.java:916)
at soot.PackManager.runBodyPacks(PackManager.java:584)
at soot.PackManager.runBodyPacks(PackManager.java:487)
at soot.PackManager.runPacksNormally(PackManager.java:464)
at soot.PackManager.runPacks(PackManager.java:388)
at soot.Main.run(Main.java:203)
at soot.Main.main(Main.java:146)
at mysoot.main(mysoot.java:33)
I've tried both the stable and nightly version of Soot.

Closing comment (2014-08-07T09:35:48Z): Looks like a duplicate of #198