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 @@ -261,13 +261,6 @@ extern "C" fn atexit_handler() {
261261
262262impl Drop for UnwindRegistry {
263263 fn drop ( & mut self ) {
264- // We don't want to deregister frames in UnwindRegistry::Drop as that could be called during
265- // program shutdown and can collide with release_registered_frames and lead to
266- // crashes.
267- if EXIT_CALLED . load ( Ordering :: SeqCst ) {
268- return ;
269- }
270-
271264 if self . published {
272265 unsafe {
273266 // libgcc stores the frame entries as a linked list in decreasing sort order
@@ -287,6 +280,12 @@ impl Drop for UnwindRegistry {
287280
288281 #[ cfg( not( all( target_os = "macos" , target_arch = "aarch64" ) ) ) ]
289282 {
283+ // We don't want to deregister frames in UnwindRegistry::Drop as that could be called during
284+ // program shutdown and can collide with release_registered_frames and lead to
285+ // crashes.
286+ if EXIT_CALLED . load ( Ordering :: SeqCst ) {
287+ return ;
288+ }
290289 __deregister_frame ( * registration as * const _ ) ;
291290 }
292291 }
You can’t perform that action at this time.
0 commit comments