mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 11:42:30 +00:00 
			
		
		
		
	Fixed bug in parsing real constants
This commit is contained in:
		
							parent
							
								
									5d6765a9d2
								
							
						
					
					
						commit
						7f755dec75
					
				
					 1 changed files with 4 additions and 4 deletions
				
			
		|  | @ -1378,10 +1378,10 @@ basic_expr: | |||
| 	} | | ||||
| 	TOK_REALVAL { | ||||
| 		$$ = new AstNode(AST_REALVALUE); | ||||
| 		char *p = strdup($1->c_str()), *q; | ||||
| 		for (int i = 0, j = 0; !p[j]; j++) | ||||
| 			if (p[j] != '_') | ||||
| 				p[i++] = p[j], p[i] = 0; | ||||
| 		char *p = (char*)malloc(GetSize(*$1) + 1), *q; | ||||
| 		for (int i = 0, j = 0; j < GetSize(*$1); j++) | ||||
| 			if ((*$1)[j] != '_') | ||||
| 				p[i++] = (*$1)[j], p[i] = 0; | ||||
| 		$$->realvalue = strtod(p, &q); | ||||
| 		log_assert(*q == 0); | ||||
| 		delete $1; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue