@@ -46,7 +46,7 @@ void ResolutionErrorTable::add_entry(int index, unsigned int hash,
4646 entry->set_cp_index (cp_index);
4747 entry->set_error (error);
4848 entry->set_message (message);
49- entry->set_nest_host_error (NULL );
49+ entry->init_nest_host_error (NULL );
5050 entry->set_cause (cause);
5151 entry->set_cause_msg (cause_msg);
5252
@@ -62,8 +62,11 @@ void ResolutionErrorTable::add_entry(int index, unsigned int hash,
6262 assert (!pool.is_null () && message != NULL , " adding NULL obj" );
6363
6464 ResolutionErrorEntry* entry = (ResolutionErrorEntry*)Hashtable<ConstantPool*, mtClass>::new_entry (hash, pool ());
65+ tty->print (" GLGL: %d, " INTPTR_FORMAT " , " INTPTR_FORMAT " \n " , entry->cp_index (), p2i (entry->cause_msg ()), p2i (entry->nest_host_error ()));
66+
67+
6568 entry->set_cp_index (cp_index);
66- entry->set_nest_host_error (message);
69+ entry->init_nest_host_error (message);
6770 entry->set_error (NULL );
6871 entry->set_message (NULL );
6972 entry->set_cause (NULL );
@@ -112,6 +115,14 @@ void ResolutionErrorEntry::set_cause_msg(const char* c) {
112115
113116// The incoming nest host error message is already in the C-Heap.
114117void ResolutionErrorEntry::set_nest_host_error (const char * message) {
118+ // If a message is already set, free it.
119+ if (nest_host_error () != nullptr ) {
120+ FREE_C_HEAP_ARRAY (char , _nest_host_error);
121+ }
122+ init_nest_host_error (message);
123+ }
124+
125+ void ResolutionErrorEntry::init_nest_host_error (const char * message) {
115126 _nest_host_error = message;
116127}
117128
0 commit comments