1
1
/*
2
- * Copyright (c) 1999, 2022 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 1999, 2023 , Oracle and/or its affiliates. All rights reserved.
3
3
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
4
4
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5
5
*
@@ -112,14 +112,14 @@ address os::fetch_frame_from_context(const void* ucVoid,
112
112
address epc;
113
113
const ucontext_t * uc = (const ucontext_t *)ucVoid;
114
114
115
- if (uc != NULL ) {
115
+ if (uc != nullptr ) {
116
116
epc = os::Posix::ucontext_get_pc (uc);
117
117
if (ret_sp) *ret_sp = os::Linux::ucontext_get_sp (uc);
118
118
if (ret_fp) *ret_fp = os::Linux::ucontext_get_fp (uc);
119
119
} else {
120
- epc = NULL ;
121
- if (ret_sp) *ret_sp = (intptr_t *)NULL ;
122
- if (ret_fp) *ret_fp = (intptr_t *)NULL ;
120
+ epc = nullptr ;
121
+ if (ret_sp) *ret_sp = (intptr_t *)nullptr ;
122
+ if (ret_fp) *ret_fp = (intptr_t *)nullptr ;
123
123
}
124
124
125
125
return epc;
@@ -174,20 +174,20 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,
174
174
175
175
/*
176
176
NOTE: does not seem to work on linux.
177
- if (info == NULL || info->si_code <= 0 || info->si_code == SI_NOINFO) {
177
+ if (info == nullptr || info->si_code <= 0 || info->si_code == SI_NOINFO) {
178
178
// can't decode this kind of signal
179
- info = NULL ;
179
+ info = nullptr ;
180
180
} else {
181
181
assert(sig == info->si_signo, "bad siginfo");
182
182
}
183
183
*/
184
184
// decide if this trap can be handled by a stub
185
- address stub = NULL ;
185
+ address stub = nullptr ;
186
186
187
- address pc = NULL ;
187
+ address pc = nullptr ;
188
188
189
189
// %note os_trap_1
190
- if (info != NULL && uc != NULL && thread != NULL ) {
190
+ if (info != nullptr && uc != nullptr && thread != nullptr ) {
191
191
pc = (address) os::Posix::ucontext_get_pc (uc);
192
192
193
193
address addr = (address) info->si_addr ;
@@ -225,9 +225,9 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,
225
225
// here if the underlying file has been truncated.
226
226
// Do not crash the VM in such a case.
227
227
CodeBlob* cb = CodeCache::find_blob (pc);
228
- CompiledMethod* nm = (cb != NULL ) ? cb->as_compiled_method_or_null () : NULL ;
228
+ CompiledMethod* nm = (cb != nullptr ) ? cb->as_compiled_method_or_null () : nullptr ;
229
229
bool is_unsafe_arraycopy = (thread->doing_unsafe_access () && UnsafeCopyMemory::contains_pc (pc));
230
- if ((nm != NULL && nm->has_unsafe_access ()) || is_unsafe_arraycopy) {
230
+ if ((nm != nullptr && nm->has_unsafe_access ()) || is_unsafe_arraycopy) {
231
231
address next_pc = pc + NativeCall::instruction_size;
232
232
if (is_unsafe_arraycopy) {
233
233
next_pc = UnsafeCopyMemory::page_error_continue_pc (pc);
@@ -248,7 +248,7 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,
248
248
// End life with a fatal error, message and detail message and the context.
249
249
// Note: no need to do any post-processing here (e.g. signal chaining)
250
250
va_list va_dummy;
251
- VMError::report_and_die (thread, uc, NULL , 0 , msg, detail_msg, va_dummy);
251
+ VMError::report_and_die (thread, uc, nullptr , 0 , msg, detail_msg, va_dummy);
252
252
va_end (va_dummy);
253
253
254
254
ShouldNotReachHere ();
@@ -290,9 +290,9 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,
290
290
}
291
291
}
292
292
293
- if (stub != NULL ) {
293
+ if (stub != nullptr ) {
294
294
// save all thread context in case we need to restore it
295
- if (thread != NULL ) thread->set_saved_exception_pc (pc);
295
+ if (thread != nullptr ) thread->set_saved_exception_pc (pc);
296
296
297
297
os::Posix::ucontext_set_pc (uc, stub);
298
298
return true ;
@@ -331,7 +331,7 @@ size_t os::Posix::default_stack_size(os::ThreadType thr_type) {
331
331
// helper functions for fatal error handler
332
332
333
333
void os::print_context (outputStream *st, const void *context) {
334
- if (context == NULL ) return ;
334
+ if (context == nullptr ) return ;
335
335
336
336
const ucontext_t *uc = (const ucontext_t *)context;
337
337
@@ -343,7 +343,7 @@ void os::print_context(outputStream *st, const void *context) {
343
343
}
344
344
345
345
void os::print_tos_pc (outputStream *st, const void *context) {
346
- if (context == NULL ) return ;
346
+ if (context == nullptr ) return ;
347
347
348
348
const ucontext_t * uc = (const ucontext_t *)context;
349
349
@@ -360,7 +360,7 @@ void os::print_tos_pc(outputStream *st, const void *context) {
360
360
}
361
361
362
362
void os::print_register_info (outputStream *st, const void *context) {
363
- if (context == NULL ) return ;
363
+ if (context == nullptr ) return ;
364
364
365
365
const ucontext_t *uc = (const ucontext_t *)context;
366
366
0 commit comments