diff --git a/src/frontend/measure.c b/src/frontend/measure.c index 9ca735a3f..c91715a11 100644 --- a/src/frontend/measure.c +++ b/src/frontend/measure.c @@ -283,6 +283,22 @@ do_measure( resname = gettok(&line); meastype = gettok(&line); + if (!an_type){ + fprintf(cp_err, "\nWarning: Incomplete measurement statement in line\n %s\nignored!\n", meas_card->line); + continue; + } + if (!resname){ + fprintf(cp_err, "\nWarning: Incomplete measurement statement in line\n %s\nignored!\n", meas_card->line); + tfree(an_type); + continue; + } + if (!meastype) { + fprintf(cp_err, "\nWarning: Incomplete measurement statement in line\n %s\nignored!\n", meas_card->line); + tfree(an_type); + tfree(resname); + continue; + } + if (chkAnalysisType(an_type) != TRUE) { if (!chk_only) { fprintf(cp_err, "Error: unrecognized analysis type '%s' for the following .meas statement on line %d:\n", an_type, meas_card->linenum); @@ -399,6 +415,20 @@ do_measure( resname = gettok(&line); meastype = gettok(&line); + if (!an_type) { + /* Warnings have already been issued in first pass */ + continue; + } + if (!resname) { + tfree(an_type); + continue; + } + if (!meastype) { + tfree(an_type); + tfree(resname); + continue; + } + if (chkAnalysisType(an_type) != TRUE) { if (!chk_only) { fprintf(cp_err, "Error: unrecognized analysis type '%s' for the following .meas statement on line %d:\n", an_type, meas_card->linenum);