Corrected an error that allows a variable to be used uninitialized
in parallel_sort, resulting in a (potentially intermittant) segfault condition.
This commit is contained in:
parent
f12d03fcff
commit
0e03f0bf97
|
|
@ -3860,6 +3860,7 @@ void parallel_sort(struct objlist *ob1, struct nlist *tp1, int idx1, int run)
|
||||||
cval = 0.0;
|
cval = 0.0;
|
||||||
for (i = 0; i < run; i++) {
|
for (i = 0; i < run; i++) {
|
||||||
merge_type = MERGE_NONE;
|
merge_type = MERGE_NONE;
|
||||||
|
ml = NULL;
|
||||||
for (p = 0;; p++) {
|
for (p = 0;; p++) {
|
||||||
vl = &(obp->instance.props[p]);
|
vl = &(obp->instance.props[p]);
|
||||||
if (vl->type == PROP_ENDLIST) break;
|
if (vl->type == PROP_ENDLIST) break;
|
||||||
|
|
@ -3888,11 +3889,11 @@ void parallel_sort(struct objlist *ob1, struct nlist *tp1, int idx1, int run)
|
||||||
}
|
}
|
||||||
if (merge_type == MERGE_P_ADD) {
|
if (merge_type == MERGE_P_ADD) {
|
||||||
proplist[i].value = cval * (double)mval;
|
proplist[i].value = cval * (double)mval;
|
||||||
ml->value.ival = 1;
|
if (ml) ml->value.ival = 1;
|
||||||
}
|
}
|
||||||
else if (merge_type == MERGE_P_PAR) {
|
else if (merge_type == MERGE_P_PAR) {
|
||||||
proplist[i].value = cval / (double)mval;
|
proplist[i].value = cval / (double)mval;
|
||||||
ml->value.ival = 1;
|
if (ml) ml->value.ival = 1;
|
||||||
}
|
}
|
||||||
proplist[i].idx = i;
|
proplist[i].idx = i;
|
||||||
proplist[i].ob = obp;
|
proplist[i].ob = obp;
|
||||||
|
|
@ -3904,6 +3905,7 @@ void parallel_sort(struct objlist *ob1, struct nlist *tp1, int idx1, int run)
|
||||||
/* and recalculate all the proplist values. */
|
/* and recalculate all the proplist values. */
|
||||||
mval = 1;
|
mval = 1;
|
||||||
obp = obn;
|
obp = obn;
|
||||||
|
ml = NULL;
|
||||||
merge_type = MERGE_NONE;
|
merge_type = MERGE_NONE;
|
||||||
for (i = 0; i < run; i++) {
|
for (i = 0; i < run; i++) {
|
||||||
for (p = 0;; p++) {
|
for (p = 0;; p++) {
|
||||||
|
|
@ -3935,11 +3937,11 @@ void parallel_sort(struct objlist *ob1, struct nlist *tp1, int idx1, int run)
|
||||||
}
|
}
|
||||||
if (merge_type == MERGE_P_ADD) {
|
if (merge_type == MERGE_P_ADD) {
|
||||||
proplist[i].value = cval * (double)mval;
|
proplist[i].value = cval * (double)mval;
|
||||||
ml->value.ival = 1;
|
if (ml) ml->value.ival = 1;
|
||||||
}
|
}
|
||||||
else if (merge_type == MERGE_P_PAR) {
|
else if (merge_type == MERGE_P_PAR) {
|
||||||
proplist[i].value = cval / (double)mval;
|
proplist[i].value = cval / (double)mval;
|
||||||
ml->value.ival = 1;
|
if (ml) ml->value.ival = 1;
|
||||||
}
|
}
|
||||||
obp = obp->next;
|
obp = obp->next;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -210,6 +210,7 @@ struct hashdict *definitions = (struct hashdict *)NULL;
|
||||||
/*----------------------------------------------------------------------*/
|
/*----------------------------------------------------------------------*/
|
||||||
/* TrimQuoted() --- */
|
/* TrimQuoted() --- */
|
||||||
/* Remove spaces from inside single- or double-quoted strings. */
|
/* Remove spaces from inside single- or double-quoted strings. */
|
||||||
|
/* Ignore verilog constant bits (e.g., "1'b0") when parsing. */
|
||||||
/*----------------------------------------------------------------------*/
|
/*----------------------------------------------------------------------*/
|
||||||
|
|
||||||
void TrimQuoted(char *line)
|
void TrimQuoted(char *line)
|
||||||
|
|
@ -225,6 +226,13 @@ void TrimQuoted(char *line)
|
||||||
{
|
{
|
||||||
changed = FALSE;
|
changed = FALSE;
|
||||||
qstart = strchr(lptr, '\'');
|
qstart = strchr(lptr, '\'');
|
||||||
|
if (qstart && (qstart > lptr)) {
|
||||||
|
if (isdigit(*(qstart - 1))) {
|
||||||
|
lptr = qstart + 1;
|
||||||
|
changed = TRUE;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (qstart)
|
if (qstart)
|
||||||
{
|
{
|
||||||
qend = strchr(qstart + 1, '\'');
|
qend = strchr(qstart + 1, '\'');
|
||||||
|
|
|
||||||
|
|
@ -634,7 +634,7 @@ void ReadVerilogFile(char *fname, int filenum, struct cellstack **CellStackPtr,
|
||||||
char *paramval = NULL;
|
char *paramval = NULL;
|
||||||
|
|
||||||
// Pick up key = value pairs and store in current cell. Look only
|
// Pick up key = value pairs and store in current cell. Look only
|
||||||
// at the keyword before "=". Then set the defition as everything
|
// at the keyword before "=". Then set the definition as everything
|
||||||
// remaining in the line, excluding comments, until the end-of-statement
|
// remaining in the line, excluding comments, until the end-of-statement
|
||||||
|
|
||||||
while (nexttok != NULL)
|
while (nexttok != NULL)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue