X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=bugmessage.h;fp=bugmessage.h;h=bd7d0b68e891eb57004fb4d59a9d344505c33cd8;hb=53a04a6ac7cbbf37880effe033704143bd6aaaaf;hp=0000000000000000000000000000000000000000;hpb=56596a27332a3622b935d5b75f81f4773dcbf757;p=model-checker.git diff --git a/bugmessage.h b/bugmessage.h new file mode 100644 index 0000000..bd7d0b6 --- /dev/null +++ b/bugmessage.h @@ -0,0 +1,21 @@ +#ifndef __BUGMESSAGE_H__ +#define __BUGMESSAGE_H__ + +#include "common.h" +#include "mymemory.h" + +struct bug_message { + bug_message(const char *str) { + const char *fmt = " [BUG] %s\n"; + msg = (char *)snapshot_malloc(strlen(fmt) + strlen(str)); + sprintf(msg, fmt, str); + } + ~bug_message() { if (msg) snapshot_free(msg); } + + char *msg; + void print() { model_print("%s", msg); } + + SNAPSHOTALLOC +}; + +#endif /* __BUGMESSAGE_H__ */