[Joeq-checkins] SF.net SVN: joeq:[2484] trunk/joeq_core/joeq/Runtime/BasicReflectionImpl. java
Status: Alpha
Brought to you by:
joewhaley
From: <joe...@us...> - 2014-02-26 06:27:26
|
Revision: 2484 http://sourceforge.net/p/joeq/svn/2484 Author: joewhaley Date: 2014-02-26 06:27:08 +0000 (Wed, 26 Feb 2014) Log Message: ----------- Fix putstatic_* in reflective interpreter. Thanks to Ryan Propper for finding this bug. Modified Paths: -------------- trunk/joeq_core/joeq/Runtime/BasicReflectionImpl.java Modified: trunk/joeq_core/joeq/Runtime/BasicReflectionImpl.java =================================================================== --- trunk/joeq_core/joeq/Runtime/BasicReflectionImpl.java 2008-10-30 01:02:25 UTC (rev 2483) +++ trunk/joeq_core/joeq/Runtime/BasicReflectionImpl.java 2014-02-26 06:27:08 UTC (rev 2484) @@ -528,44 +528,44 @@ } public void putstatic_I(jq_StaticField f, int v) { Assert._assert(f.getType() == jq_Primitive.INT); - f.getDeclaringClass().setStaticData(f, v); + Reflection.obj_trav.putStaticFieldValue(f, new Integer(v)); } public void putstatic_L(jq_StaticField f, long v) { Assert._assert(f.getType() == jq_Primitive.LONG); - f.getDeclaringClass().setStaticData(f, v); + Reflection.obj_trav.putStaticFieldValue(f, new Long(v)); } public void putstatic_F(jq_StaticField f, float v) { Assert._assert(f.getType() == jq_Primitive.FLOAT); - f.getDeclaringClass().setStaticData(f, v); + Reflection.obj_trav.putStaticFieldValue(f, new Float(v)); } public void putstatic_D(jq_StaticField f, double v) { Assert._assert(f.getType() == jq_Primitive.DOUBLE); - f.getDeclaringClass().setStaticData(f, v); + Reflection.obj_trav.putStaticFieldValue(f, new Double(v)); } public void putstatic_A(jq_StaticField f, Object v) { Assert._assert(v == null || TypeCheck.isAssignable(jq_Reference.getTypeOf(v), f.getType())); Assert._assert(!f.getType().isAddressType()); - f.getDeclaringClass().setStaticData(f, v); + Reflection.obj_trav.putStaticFieldValue(f, v); } public void putstatic_P(jq_StaticField f, Address v) { Assert._assert(f.getType().isAddressType()); - f.getDeclaringClass().setStaticData(f, v); + Reflection.obj_trav.putStaticFieldValue(f, v); } public void putstatic_Z(jq_StaticField f, boolean v) { Assert._assert(f.getType() == jq_Primitive.BOOLEAN); - f.getDeclaringClass().setStaticData(f, v?1:0); + Reflection.obj_trav.putStaticFieldValue(f, Convert.getBoolean(v)); } public void putstatic_B(jq_StaticField f, byte v) { Assert._assert(f.getType() == jq_Primitive.BYTE); - f.getDeclaringClass().setStaticData(f, (int)v); + Reflection.obj_trav.putStaticFieldValue(f, new Byte(v)); } public void putstatic_S(jq_StaticField f, short v) { Assert._assert(f.getType() == jq_Primitive.SHORT); - f.getDeclaringClass().setStaticData(f, (int)v); + Reflection.obj_trav.putStaticFieldValue(f, new Short(v)); } public void putstatic_C(jq_StaticField f, char v) { Assert._assert(f.getType() == jq_Primitive.CHAR); - f.getDeclaringClass().setStaticData(f, (int)v); + Reflection.obj_trav.putStaticFieldValue(f, new Character(v)); } public int arraylength(Object o) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |