comparison src/share/vm/graal/graalCodeInstaller.cpp @ 7716:fa8a56a351a5

null-check on leafGraphArray
author Roland Schatz <roland.schatz@oracle.com>
date Tue, 05 Feb 2013 15:24:15 +0100
parents 0b646334c5f7
children a7a93887b4c4
comparison
equal deleted inserted replaced
7715:ab7a97237115 7716:fa8a56a351a5
289 } 289 }
290 290
291 GrowableArray<jlong>* get_leaf_graph_ids(Handle& comp_result) { 291 GrowableArray<jlong>* get_leaf_graph_ids(Handle& comp_result) {
292 arrayOop leafGraphArray = (arrayOop) CompilationResult::leafGraphIds(HotSpotCompilationResult::comp(comp_result)); 292 arrayOop leafGraphArray = (arrayOop) CompilationResult::leafGraphIds(HotSpotCompilationResult::comp(comp_result));
293 293
294 GrowableArray<jlong>* result = new GrowableArray<jlong>(leafGraphArray->length()); 294 jint length;
295 for (int i = 0; i < leafGraphArray->length(); i++) { 295 if (leafGraphArray == NULL) {
296 length = 0;
297 } else {
298 length = leafGraphArray->length();
299 }
300
301 GrowableArray<jlong>* result = new GrowableArray<jlong>(length);
302 for (int i = 0; i < length; i++) {
296 result->append(((jlong*) leafGraphArray->base(T_LONG))[i]); 303 result->append(((jlong*) leafGraphArray->base(T_LONG))[i]);
297 } 304 }
298 305
299 return result; 306 return result;
300 } 307 }