X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=common.h;h=7be72d72f8e0b56fc8f333ffe25489685b053f60;hb=refs%2Fheads%2Fmaster;hp=367dc6b2b00098b9380e400bea68e69771f91e8c;hpb=c108b7d5709061ced258f5106ac67ada91242fc3;p=model-checker.git diff --git a/common.h b/common.h index 367dc6b..7be72d7 100644 --- a/common.h +++ b/common.h @@ -9,8 +9,9 @@ #include "config.h" extern int model_out; +extern int switch_alloc; -#define model_print(fmt, ...) do { dprintf(model_out, fmt, ##__VA_ARGS__); } while (0) +#define model_print(fmt, ...) do { switch_alloc = 1; dprintf(model_out, fmt, ##__VA_ARGS__); switch_alloc = 0; } while (0) #ifdef CONFIG_DEBUG #define DEBUG(fmt, ...) do { model_print("*** %15s:%-4d %25s() *** " fmt, __FILE__, __LINE__, __func__, ##__VA_ARGS__); } while (0) @@ -29,7 +30,7 @@ void assert_hook(void); do { \ if (!(expr)) { \ fprintf(stderr, "Error: assertion failed in %s at line %d\n", __FILE__, __LINE__); \ - print_trace(); \ + /* print_trace(); // Trace printing may cause dynamic memory allocation */ \ assert_hook(); \ exit(EXIT_FAILURE); \ } \