Author: mturk
Date: Thu Jun 18 08:20:23 2009
New Revision: 785947
URL: http://svn.apache.org/viewvc?rev=785947&view=rev
Log:
Use correct filed setter for pointer length
Modified:
commons/sandbox/runtime/trunk/src/main/native/shared/pointer.c
Modified: commons/sandbox/runtime/trunk/src/main/native/shared/pointer.c
URL:
http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/pointer.c?rev=785947&r1=785946&r2=785947&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/pointer.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/pointer.c Thu Jun 18
08:20:23 2009
@@ -137,17 +137,16 @@
if (_clazzn.i && J4MID(0000)) {
acr_pointer_cleanup_fn_t *cleanup;
void *pointer;
- size_t plength;
pointer = GET_IFIELD_V(0000, _O, void *);
cleanup = GET_IFIELD_V(0001, _O, acr_pointer_cleanup_fn_t *);
- plength = GET_IFIELD_I(0002, _O);
if (pointer) {
SET_IFIELD_P(0000, _O, NULL);
}
if (cleanup) {
- int rc = (*cleanup)(pointer, plength);
- if (rc) {
+ int rc;
+ size_t plength = (size_t)GET_IFIELD_P(0002, _O);
+ if ((rc = (*cleanup)(pointer, plength))) {
/* Throw RuntimeException with errno message */
ACR_ThrowException(_E, THROW_FMARK, ACR_EX_ERUNTIME, rc);
}
@@ -163,15 +162,14 @@
if (_clazzn.i && J4MID(0000)) {
acr_pointer_cleanup_fn_t *cleanup;
void *pointer;
- size_t plength;
pointer = GET_IFIELD_V(0000, _O, void *);
cleanup = GET_IFIELD_V(0001, _O, acr_pointer_cleanup_fn_t *);
- plength = GET_IFIELD_I(0002, _O);
if (pointer) {
SET_IFIELD_P(0000, _O, NULL);
}
if (cleanup) {
+ size_t plength = (size_t)GET_IFIELD_P(0002, _O);
(*cleanup)(pointer, plength);
}
}
@@ -230,7 +228,6 @@
if (_clazzn.i && J4MID(0000) && _O) {
acr_pointer_cleanup_fn_t *cleanup;
void *pointer;
- size_t plength;
if ((*_E)->MonitorEnter(_E, _O)) {
/* Object locking failed */
@@ -238,7 +235,6 @@
}
pointer = GET_IFIELD_V(0000, _O, void *);
cleanup = GET_IFIELD_V(0001, _O, acr_pointer_cleanup_fn_t *);
- plength = GET_IFIELD_I(0002, _O);
if (pointer) {
SET_IFIELD_P(0000, _O, NULL);
}
@@ -247,6 +243,7 @@
}
(*_E)->MonitorExit(_E, _O);
if (cleanup) {
+ size_t plength = (size_t)GET_IFIELD_P(0002, _O);
return (*cleanup)(pointer, plength);
}
else {