projects
/
yosys.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5d6765a
)
Fixed bug in parsing real constants
author
Clifford Wolf
<clifford@clifford.at>
Sat, 6 Aug 2016 11:16:23 +0000
(13:16 +0200)
committer
Clifford Wolf
<clifford@clifford.at>
Sat, 6 Aug 2016 11:16:23 +0000
(13:16 +0200)
frontends/verilog/verilog_parser.y
patch
|
blob
|
history
diff --git
a/frontends/verilog/verilog_parser.y
b/frontends/verilog/verilog_parser.y
index c2327011f23825c9f20733a7aebdad0ec27a48ba..7b025db2355913eb4f811d5b0497951ccb4067e2 100644
(file)
--- a/
frontends/verilog/verilog_parser.y
+++ b/
frontends/verilog/verilog_parser.y
@@
-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;