[Sablevm-bugs] [ sablevm-Bugs-693916 ] dead code?
Brought to you by:
egagnon
From: SourceForge.net <no...@so...> - 2003-02-26 21:29:16
|
Bugs item #693916, was opened at 2003-02-26 16:38 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105523&aid=693916&group_id=5523 Category: Other Group: SableVM Status: Open Resolution: None Priority: 5 Submitted By: David Bélanger (davidbelanger) Assigned to: Nobody/Anonymous (nobody) Summary: dead code? Initial Comment: File: global_alloc.m4.c See code at end. Unless nmemb can be negative, size will never be smaller than nmemb. So, if (size < nmemb) { _svmf_error_OutOfMemoryError (env); return JNI_ERR; } in the code below will never be executed. static jint _svmh_gzmalloc_instruction_preparation (_svmt_JNIEnv *env, size_t nmemb, _svmt_instruction_preparation ** ptr) { _svmt_instruction_preparation *tmp; size_t size = nmemb * sizeof (_svmt_instruction_preparation); if (size < nmemb) { _svmf_error_OutOfMemoryError (env); return JNI_ERR; } tmp = _svmf_calloc (1, size); if (tmp == NULL) { _svmf_error_OutOfMemoryError (env); return JNI_ERR; } *ptr = tmp; return JNI_OK; } David ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105523&aid=693916&group_id=5523 |