mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	Fixes for some of clang scan-build detected issues
This commit is contained in:
		
							parent
							
								
									956c4e485a
								
							
						
					
					
						commit
						6574553189
					
				
					 15 changed files with 39 additions and 23 deletions
				
			
		| 
						 | 
				
			
			@ -530,8 +530,9 @@ struct DumpPass : public Pass {
 | 
			
		|||
 | 
			
		||||
		std::ostream *f;
 | 
			
		||||
		std::stringstream buf;
 | 
			
		||||
		bool empty = filename.empty();
 | 
			
		||||
 | 
			
		||||
		if (!filename.empty()) {
 | 
			
		||||
		if (!empty) {
 | 
			
		||||
			rewrite_filename(filename);
 | 
			
		||||
			std::ofstream *ff = new std::ofstream;
 | 
			
		||||
			ff->open(filename.c_str(), append ? std::ofstream::app : std::ofstream::trunc);
 | 
			
		||||
| 
						 | 
				
			
			@ -546,7 +547,7 @@ struct DumpPass : public Pass {
 | 
			
		|||
 | 
			
		||||
		RTLIL_BACKEND::dump_design(*f, design, true, flag_m, flag_n);
 | 
			
		||||
 | 
			
		||||
		if (!filename.empty()) {
 | 
			
		||||
		if (!empty) {
 | 
			
		||||
			delete f;
 | 
			
		||||
		} else {
 | 
			
		||||
			log("%s", buf.str().c_str());
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue