[Sablevm-bugs] [ sablevm-Bugs-692638 ] bug jni getFieldID and others
Brought to you by:
egagnon
From: SourceForge.net <no...@so...> - 2004-07-03 21:09:36
|
Bugs item #692638, was opened at 2003-02-24 20:08 Message generated for change (Comment added) made by egagnon You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105523&aid=692638&group_id=5523 Category: None Group: None >Status: Closed 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 ---------------------------------------------------------------------- Comment By: Etienne M. Gagnon (egagnon) Date: 2004-07-03 17:09 Message: Logged In: YES user_id=15365 This bug has been moved to the new SableVM Bug Tracking System. Please visit: http://sablevm.org/bugs ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105523&aid=692638&group_id=5523 |