# HG changeset patch # User Roland Schatz # Date 1360074255 -3600 # Node ID fa8a56a351a569882695a63b87060d73d5bf60be # Parent ab7a97237115bd7dbf96343a5329facde323d8a4 null-check on leafGraphArray diff -r ab7a97237115 -r fa8a56a351a5 src/share/vm/graal/graalCodeInstaller.cpp --- a/src/share/vm/graal/graalCodeInstaller.cpp Tue Feb 05 13:54:18 2013 +0100 +++ b/src/share/vm/graal/graalCodeInstaller.cpp Tue Feb 05 15:24:15 2013 +0100 @@ -291,8 +291,15 @@ GrowableArray* get_leaf_graph_ids(Handle& comp_result) { arrayOop leafGraphArray = (arrayOop) CompilationResult::leafGraphIds(HotSpotCompilationResult::comp(comp_result)); - GrowableArray* result = new GrowableArray(leafGraphArray->length()); - for (int i = 0; i < leafGraphArray->length(); i++) { + jint length; + if (leafGraphArray == NULL) { + length = 0; + } else { + length = leafGraphArray->length(); + } + + GrowableArray* result = new GrowableArray(length); + for (int i = 0; i < length; i++) { result->append(((jlong*) leafGraphArray->base(T_LONG))[i]); }