mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 11:42:30 +00:00 
			
		
		
		
	fixed a crash when lines start with whitespace
This commit is contained in:
		
							parent
							
								
									2192873daa
								
							
						
					
					
						commit
						15ad2db8fc
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		|  | @ -132,7 +132,7 @@ void Pass::extra_args(std::vector<std::string> args, size_t argidx, RTLIL::Desig | |||
| void Pass::call(RTLIL::Design *design, std::string command) | ||||
| { | ||||
| 	std::vector<std::string> args; | ||||
| 	char *s = strdup(command.c_str()), *saveptr; | ||||
| 	char *s = strdup(command.c_str()), *sstart = s, *saveptr; | ||||
| 	s += strspn(s, " \t\r\n"); | ||||
| 	if (*s == 0 || *s == '#') | ||||
| 		return; | ||||
|  | @ -160,7 +160,7 @@ void Pass::call(RTLIL::Design *design, std::string command) | |||
| 		} else | ||||
| 			args.push_back(str); | ||||
| 	} | ||||
| 	free(s); | ||||
| 	free(sstart); | ||||
| 	call(design, args); | ||||
| } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue