fix leaks
[m6w6/ext-psi] / src / parser_scan.re
index 043243fd81e12c91052f792a8570c441e288a993..f280b86ba03f4491d75cdc5b00ff816a8d7cd2b4 100644 (file)
@@ -31,6 +31,7 @@
 
 #include "parser.h"
 #include "plist.h"
 
 #include "parser.h"
 #include "plist.h"
+#include "debug.h"
 
 /*!max:re2c*/
 #ifndef YYMAXFILL
 
 /*!max:re2c*/
 #ifndef YYMAXFILL
@@ -52,8 +53,10 @@ size_t psi_parser_maxfill(void) {
                token = psi_token_init(t, tok, cur - tok, tok - eol + 1, I->lines, I->file); \
        } \
        tokens = psi_plist_add(tokens, &token); \
                token = psi_token_init(t, tok, cur - tok, tok - eol + 1, I->lines, I->file); \
        } \
        tokens = psi_plist_add(tokens, &token); \
-       PSI_DEBUG_PRINT(P, "PSI: scanned < "); \
-       PSI_DEBUG_DUMP(P, psi_token_dump, token); \
+       PSI_DEBUG_LOCK(P, \
+                       PSI_DEBUG_PRINT(P, "PSI: scanned < "); \
+                       PSI_DEBUG_DUMP(P, psi_token_dump, token); \
+       ); \
 } while(0)
 
 #define CHECKEOF() if (cur >= lim - YYMAXFILL) goto done
 } while(0)
 
 #define CHECKEOF() if (cur >= lim - YYMAXFILL) goto done