[Soot-list] sometimes cast sometimes no cast

Eric Bodden eric.bodden at uni-paderborn.de
Tue May 5 07:30:47 EDT 2020


Hi Andre.

Hmm this looks strange, particularly because it’s an up-cast and hence unnecessary.

Are you using Soot to process compiled bytecode or the original source code. If it’s bytecode then I would assume that maybe the bytecode already contains this cast, i.e., it was inserted by the compiler?

Cheers
Eric

> On 22. Apr 2020, at 15:06, André Schäfer <andre.schaefer at uni-jena.de> wrote:
> 
> Hello,
> 
> I have 2 functions in different Java classes which are almost identical in source code.
> 
> <mphcadkhbddhifpe.png>
> 
> I have now compiled the two classes myself and created the control flow graph. 
> It is about the code snippet in which the GdxRuntimeException is thrown. In the upper code snippet the sequence of nodes is as follows:
> 
> cond($r3!=null)
> assign($r4=new.com_badlogic_gdx_utils_GdxRuntimeException)
> invoke($r4.com_badlogic_gdx_utils_GdxRuntimeException.init("InstanceBufferObjectrequiresadevicerunningwithGLES3.0compatibilty"))
> throw($r4)
> 
> In the lower code snippet, the sequence of nodes is as follows:
> 
> cond($r3!=null)
> assign(r8=new.com_badlogic_gdx_utils_GdxRuntimeException)
> invoke(r8.com_badlogic_gdx_utils_GdxRuntimeException.init("InstanceBufferObjectrequiresadevicerunningwithGLES3.0compatibilty"))
> assign(r9=(java_lang_Throwable).r8)
> throw(r9)
> 
> 
> Why is the cast (marked red) performed in the lower function but not in the upper function?
> Is there a setting option within Soot for this?
> 
> With kind regards
> André
> 
> 
> _______________________________________________
> Soot-list mailing list
> Soot-list at CS.McGill.CA
> https://mailman.CS.McGill.CA/mailman/listinfo/soot-list



More information about the Soot-list mailing list