[Sablevm-bugs] [ sablevm-Bugs-692638 ] bug jni getFieldID and others
Brought to you by:
egagnon
From: SourceForge.net <no...@so...> - 2003-03-24 03:22:24
|
Bugs item #692638, was opened at 2003-02-24 20:08 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105523&aid=692638&group_id=5523 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: David Bélanger (davidbelanger) >Assigned to: David Bélanger (davidbelanger) Summary: bug jni getFieldID and others Initial Comment: Hi, I'm not a JNI expert but from what I understand GetFieldID (file: native_interface.m4.c) should return NULL on error and then the programmer knows he/she should check for any exception raised. However, it does not always return NULL on error because of this conditional: if (field == NULL || _svmf_is_set_flag (field->access_flags, SVM_ACC_STATIC)) { _svmf_error_NoSuchFieldError (env); goto end; } Field may be non-null and the 2nd expr may be true. So a non-null field id is returned. Suggested fix: if (field == NULL || _svmf_is_set_flag (field->access_flags, SVM_ACC_STATIC)) { _svmf_error_NoSuchFieldError (env); + field = NULL; goto end; } Functions affected: Get{Field,Method}ID GetStatic{Field,Method}ID and maybe others David ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105523&aid=692638&group_id=5523 |