File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
lib/compiler/src/engine/unwind Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -255,13 +255,6 @@ extern "C" fn atexit_handler() {
255255
256256impl Drop for UnwindRegistry {
257257 fn drop ( & mut self ) {
258- // We don't want to deregister frames in UnwindRegistry::Drop as that could be called during
259- // program shutdown and can collide with release_registered_frames and lead to
260- // crashes.
261- if EXIT_CALLED . load ( Ordering :: SeqCst ) {
262- return ;
263- }
264-
265258 if self . published {
266259 unsafe {
267260 // libgcc stores the frame entries as a linked list in decreasing sort order
@@ -281,6 +274,12 @@ impl Drop for UnwindRegistry {
281274
282275 #[ cfg( not( all( target_os = "macos" , target_arch = "aarch64" ) ) ) ]
283276 {
277+ // We don't want to deregister frames in UnwindRegistry::Drop as that could be called during
278+ // program shutdown and can collide with release_registered_frames and lead to
279+ // crashes.
280+ if EXIT_CALLED . load ( Ordering :: SeqCst ) {
281+ return ;
282+ }
284283 __deregister_frame ( * registration as * const _ ) ;
285284 }
286285 }
You can’t perform that action at this time.
0 commit comments