Uninitialized variable in js/src/liveconnect/jsj_JSObject.c

VERIFIED DUPLICATE of bug 205523

Status

Core Graveyard
Java: Live Connect
VERIFIED DUPLICATE of bug 205523
15 years ago
7 years ago

People

(Reporter: tenthumbs, Assigned: Patrick C. Beard)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

15 years ago
Gcc says
 jsj_JSObject.c:253: warning: `java_wrapper_obj' might be used \
 uninitialized in this function

The code is

266 #ifndef OJI
267 #if JS_BYTES_PER_LONG == 8
268     java_wrapper_obj =
269         (*jEnv)->NewObject(jEnv, njJSObject, njJSObject_JSObject,
(jlong)handle);
270 #else
271     java_wrapper_obj =
272         (*jEnv)->NewObject(jEnv, njJSObject, njJSObject_JSObject, (jint)handle);
273 #endif
274 #else
275     if (JSJ_callbacks && JSJ_callbacks->get_java_wrapper != NULL) {
276         java_wrapper_obj = JSJ_callbacks->get_java_wrapper(jEnv, (jint)handle);
277     }
278 #endif /*! OJI */
279     if (!java_wrapper_obj) {
280         jsj_UnexpectedJavaError(cx, jEnv, "Couldn't create new instance of "
281                                           "netscape.javascript.JSObject");
282         goto done;
283     }
284
285     JS_AddNamedRoot(cx, &handle->js_obj, "&handle->js_obj");
286
287 done:
288
289     return java_wrapper_obj;
290 }

Since I didn't pass --disable-oji to configure OJI is defined so
java_wrapper_obj can only be set starting at line 279 but only if certain
conditions are met.
(Reporter)

Comment 1

15 years ago
Make that "starting at line 275".

Comment 2

15 years ago
Reassigning to Patrick -
Assignee: rogerl → beard

Comment 3

15 years ago
Bug 205523 has also been filed for this, and has a patch.
Therefore I will dupe this one forward -

*** This bug has been marked as a duplicate of 205523 ***
Status: NEW → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → DUPLICATE

Comment 4

15 years ago
Verified Duplicate.

tenthumbs: thank you for this report; you have been cc'ed on bug 205523 -
Status: RESOLVED → VERIFIED

Updated

7 years ago
Component: Java: Live Connect → Java: Live Connect
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.