mirror of
				https://github.com/Z3Prover/z3
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	Fix race condition in smt_tactic::collect_statistics
Co-authored-by: levnach <5377127+levnach@users.noreply.github.com>
This commit is contained in:
		
							parent
							
								
									f094053cd0
								
							
						
					
					
						commit
						bee55f1466
					
				
					 1 changed files with 3 additions and 2 deletions
				
			
		| 
						 | 
					@ -101,8 +101,9 @@ public:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void collect_statistics(statistics & st) const override {
 | 
					    void collect_statistics(statistics & st) const override {
 | 
				
			||||||
        if (m_ctx)
 | 
					        smt::kernel * local_ctx = m_ctx;  // Capture pointer to avoid race condition
 | 
				
			||||||
            m_ctx->collect_statistics(st); // ctx is still running...
 | 
					        if (local_ctx)
 | 
				
			||||||
 | 
					            local_ctx->collect_statistics(st); // ctx is still running...
 | 
				
			||||||
        else
 | 
					        else
 | 
				
			||||||
            st.copy(m_stats);
 | 
					            st.copy(m_stats);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue