Incorrect binding code generated for long data type (Won't DUP type on stack 
top 'long' because it must occupy exactly one slot, not '2'.)
------------------------------------------------------------------------------------------------------------------------------------------

                 Key: JIBX-213
                 URL: http://jira.codehaus.org/browse/JIBX-213
             Project: JiBX
          Issue Type: Bug
          Components: Generator Tools
    Affects Versions: JiBX 1.1.5
         Environment: Windows XP Pro SP2, CPU x86 Family 15 Model 4 Stepping 1 
GenuineIntel ~3200 Mhz, RAM 2GB
Java(TM) SE Runtime Environment (build 1.6.0_04-b12)
            Reporter: Serguei Ouklonski
         Attachments: testcases.zip

For simple input-only binding incorrect code is generated when "long" data type 
is present. Identical code with "int" instead of "long" is processed correctly.

Attached is an archive containing two test cases:
     testcases
           bad-with-long
                   bind
           good-with-int
                   bind

"bind" is a top-level java package. InTest2 is a main class, InTest2.xml is 
input file. 

---------------------------------------------------------------------------------------------------------------------
An attempt to run "bad-with-long" variant resulted in: 

Exception in thread "main" java.lang.VerifyError: (class: 
bind/JiBX_MungeAdapter, method: JiBX_test_binding_in2_unmarshal_1_4 signature: 
(Lbind/MyData;Lorg/jibx/runtime/impl/UnmarshallingContext;)Lbind/MyData;) 
Attempt to split long or double on the stack
        at bind.JiBX_test_binding_in2MyData_access1.unmarshal()
        at 
org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(UnmarshallingContext.java:2537)
        at 
org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(UnmarshallingContext.java:2680)
        at bind.InTest2.main(InTest2.java:19)


Output from "org.jibx.binding.Compile -b -l bind\test-binding-in2.xml" contains 
(among other diagnostics):

Verification failure on method JiBX_test_binding_in2_unmarshal_1_2 of class 
bind.JiBX_MungeAdapter:
  VERIFIED_REJECTED
Instruction invokeinterface[185](5) 84 constraint violated: Referenced method 
'setStatus' with expected signature not found in c
lass 'bind.MyData'. The native verfier does allow the method to be declared in 
some superinterface, which the Java Virtual Machi
ne Specification, Second Edition does not.

Verification failure on method JiBX_test_binding_in2_unmarshal_1_0 of class 
bind.JiBX_MungeAdapter:
  VERIFIED_REJECTED
Constraint violated in method 'public static bind.SomeData 
JiBX_test_binding_in2_unmarshal_1_0(bind.SomeData arg1, org.jibx.runt
ime.impl.UnmarshallingContext arg2)
                throws org.jibx.runtime.JiBXException':
Instruction DUP constraint violated: Won't DUP type on stack top 'long' because 
it must occupy exactly one slot, not '2'.
InstructionHandle:   43: dup[89](1)

Execution Frame:
Local Variables:
0: bind.SomeData
1: org.jibx.runtime.impl.UnmarshallingContext
2: boolean[]
3: <unknown object>
4: <unknown object>
OperandStack:
Slots used: 4 MaxStack: 5.
long (Size: 2)
bind.SomeData (Size: 1)
bind.SomeData (Size: 1)
Execution flow:
   0: aload_0   [InstructionContext]
   1: iconst_1  [InstructionContext]
   2: newarray boolean  [InstructionContext]
   4: astore_2  [InstructionContext]
   5: nop       [InstructionContext]
   6: aload_1   [InstructionContext]
   7: aconst_null       [InstructionContext]
   8: ldc 33    [InstructionContext]
  10: invokevirtual 37  [InstructionContext]
  13: ifeq -> 53        [InstructionContext]
  16: aload_2   [InstructionContext]
  17: iconst_0  [InstructionContext]
  18: baload    [InstructionContext]
  19: ifeq -> 31        [InstructionContext]
  31: aload_2   [InstructionContext]
  32: iconst_0  [InstructionContext]
  33: iconst_1  [InstructionContext]
  34: bastore   [InstructionContext]
  35: aload_0   [InstructionContext]
  36: aload_1   [InstructionContext]
  37: aconst_null       [InstructionContext]
  38: ldc 33    [InstructionContext]
  40: invokevirtual 47  [InstructionContext]
  43: dup       [InstructionContext]




Attached is an archive containing two test cases:
     testcases
           bad-with-long
                   bind
           good-with-int
                   bind

"bind" is top-level java package.




-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
jibx-devs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-devs

Reply via email to