* src/vm/primitive.c (primitive_box): Handle PRIMITIVETYPE_VOID type.
authortwisti <none@none>
Sun, 19 Aug 2007 19:55:37 +0000 (19:55 +0000)
committertwisti <none@none>
Sun, 19 Aug 2007 19:55:37 +0000 (19:55 +0000)
(primitive_unbox): Likewise.

src/vm/primitive.c

index 81a0d34fcce5f6406d8312d222c70e0f0f0b54bb..0b59229d10e5e12a59c25db546f5ce48a33fd36c 100644 (file)
@@ -192,7 +192,8 @@ int primitive_type_get_by_wrapperclass(classinfo *c)
 
 /* primitive_box ***************************************************************
 
-   Box a primitive of the given type.
+   Box a primitive of the given type.  If the type is an object,
+   simply return it.
 
 *******************************************************************************/
 
@@ -225,6 +226,9 @@ java_handle_t *primitive_box(int type, imm_union value)
        case PRIMITIVETYPE_DOUBLE:
                o = primitive_box_double(value.d);
                break;
+       case PRIMITIVETYPE_VOID:
+               o = value.a;
+               break;
        default:
                vm_abort("primitive_box: invalid primitive type %d", type);
        }
@@ -235,7 +239,8 @@ java_handle_t *primitive_box(int type, imm_union value)
 
 /* primitive_unbox *************************************************************
 
-   Unbox a primitive of the given type.
+   Unbox a primitive of the given type.  If the type is an object,
+   simply return it.
 
 *******************************************************************************/
 
@@ -274,6 +279,11 @@ imm_union primitive_unbox(java_handle_t *o)
        case PRIMITIVETYPE_DOUBLE:
                value.d = primitive_unbox_double(o);
                break;
+       case -1:
+               /* If type is -1 the object is not a primitive box but a
+                  normal object. */
+               value.a = o;
+               break;
        default:
                vm_abort("primitive_unbox: invalid primitive type %d", type);
        }