Skip to content

Commit beff8bf

Browse files
committed
8342823: Ubsan: ciEnv.cpp:1614:65: runtime error: member call on null pointer of type 'struct CompileTask'
Reviewed-by: kvn, mdoerr
1 parent e389f82 commit beff8bf

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/hotspot/share/ci/ciEnv.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1597,6 +1597,8 @@ void ciEnv::dump_replay_data_helper(outputStream* out) {
15971597
NoSafepointVerifier no_safepoint;
15981598
ResourceMark rm;
15991599

1600+
assert(this->task() != nullptr, "task must not be null");
1601+
16001602
dump_replay_data_version(out);
16011603
#if INCLUDE_JVMTI
16021604
out->print_cr("JvmtiExport can_access_local_variables %d", _jvmti_can_access_local_variables);
@@ -1617,9 +1619,7 @@ void ciEnv::dump_replay_data_helper(outputStream* out) {
16171619
objects->at(i)->dump_replay_data(out);
16181620
}
16191621

1620-
if (this->task() != nullptr) {
1621-
dump_compile_data(out);
1622-
}
1622+
dump_compile_data(out);
16231623
out->flush();
16241624
}
16251625

src/hotspot/share/utilities/vmError.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1866,7 +1866,7 @@ void VMError::report_and_die(int id, const char* message, const char* detail_fmt
18661866
if (DumpReplayDataOnError && _thread && _thread->is_Compiler_thread() && !skip_replay) {
18671867
skip_replay = true;
18681868
ciEnv* env = ciEnv::current();
1869-
if (env != nullptr) {
1869+
if (env != nullptr && env->task() != nullptr) {
18701870
const bool overwrite = false; // We do not overwrite an existing replay file.
18711871
int fd = prepare_log_file(ReplayDataFile, "replay_pid%p.log", overwrite, buffer, sizeof(buffer));
18721872
if (fd != -1) {

0 commit comments

Comments
 (0)