+ /*DRL added 6/21/01
+ to handle reading of buffer overflow related constraints
+ */
+ while (fgets (s, MAX_DUMP_LINE_LENGTH, f) != NULL
+ && *s == ';')
+ {
+ ; /* ignore ;-comments */
+ }
+
+ /*drl July 27 added this so that libraries without
+ buffer constraints would be handled correctly.
+ I'm trying to do this without breaking older libraries*/
+
+ /*check for "optional" start buffer constraints message*/
+
+ if (mstring_equalPrefix (s, "start_Buffer_Constraints"))
+ {
+ (void) fgets (s, MAX_DUMP_LINE_LENGTH, f);
+ }
+
+ while (s != NULL && *s != ';')
+ {
+ constraintList preconditions;
+ constraintList postconditions;
+ cstring name = cstring_fromChars (reader_getWord (&s));
+ cstring temp;
+
+ ue = usymtab_lookup (name);
+ cstring_free (name);
+
+ preconditions = constraintList_undefined;
+ postconditions = constraintList_undefined;
+
+ if (!uentry_isValid(ue) )
+ {
+ llfatalbug ((message("Invalid uentry for %s library file may be corrupted", cstring_fromChars(s) ) ));
+ }
+ s = fgets (os, MAX_DUMP_LINE_LENGTH, f);
+
+ temp = cstring_fromChars (reader_getWord(&s) );
+
+ if (cstring_compareLit (temp,"pre:") == 0 )
+ {
+ preconditions = constraintList_undump (f);
+ }
+ else
+ {
+ if (cstring_compareLit (temp,"pre:EMPTY") != 0 )
+ llfatalbug ((message("Error reading library file pre:EMPTY expected but got %s", temp ) ));
+ }
+
+ cstring_free(temp);
+
+ s = fgets (os, MAX_DUMP_LINE_LENGTH, f);
+
+ temp = cstring_fromChars(reader_getWord(&s) );
+ if (cstring_compareLit (temp, "post:") == 0 )
+ {
+ postconditions = constraintList_undump (f);
+ }
+ else
+ {
+ if (cstring_compareLit (temp, "post:EMPTY") != 0 )
+ llfatalbug ((message("Error reading library file post:EMPTY expected but got %s", temp ) ));
+ }
+
+ cstring_free (temp);
+
+ uentry_setPreconditions (ue, functionConstraint_createBufferConstraint (preconditions));
+ uentry_setPostconditions (ue, functionConstraint_createBufferConstraint (postconditions));
+
+ s = fgets (os, MAX_DUMP_LINE_LENGTH, f);
+ }
+