[Soot-list] 'local type not allowed in final code: null_type local' while processing android-support-v4.jar (JVM bytecode, not Dex)

Lázaro Clapp lazaro.clapp at gmail.com
Tue Jun 10 22:41:13 EDT 2014


While using soot to process code using the Android Support Library
(android-support-v4.jar in JVM bytecode form, not dex), I get the following
error:

     "Exception in thread "main" java.lang.RuntimeException:
(<android.support.v4.app.FragmentActivity: android.view.View
onCreateView(java.lang.String,android.content.Context,android.util.AttributeSet)>)
local type not allowed in final code: null_type local: n0 body"

Here is the relevant subset of that method's Jimple:

     ...
        null_type n0;
     ...
        n0 = null;
        if null == null goto label03;

        $i2 = virtualinvoke n0.<android.view.View: int getId()>();
        goto label04;

     label03:
        $i2 = 0;

     label04:
     ...

And the corresponding Java code:
     ...
     View parent = null; // NOTE: no way to get parent pre-Honeycomb.
     int containerId = parent != null ? parent.getId() : 0;
     ...

(from
http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.0.1_r1/android/support/v4/app/FragmentActivity.java
)

And JVM bytecode:

   73:  aconst_null
   74:  astore  8
   76:  aload   8
   78:  ifnull  89
   81:  aload   8
   83:  invokevirtual   #56; //Method android/view/View.getId:()I
   86:  goto    90
   89:  iconst_0

As far as I can understand it, soot should be either optimizing away the
false branch of the (always true) 'if(null == null)' check and therefore
eliminating n0 as unused, or else it should be able to tell that the type
of n0 is android.view.View. But neither is happening and the jimple code
being produced fails to validate because it contains the local n0 which has
null_type.

For reference, I am running soot with both -O and -validate and using
soot's 'develop' branch.

Is this intended behavior? A bug in soot?

Lazaro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20140611/a343e9ab/attachment.html 


More information about the Soot-list mailing list