From 7c2707a0e0758fd54ef9e44afbdf37afd07e587b Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Wed, 17 Jan 2007 01:54:15 +0100 Subject: [PATCH] More checks for objects that should not live outside parser. --- lily/include/smobs.hh | 6 +++++- lily/skyline.cc | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lily/include/smobs.hh b/lily/include/smobs.hh index a8f3ac5164..5bd403bce4 100644 --- a/lily/include/smobs.hh +++ b/lily/include/smobs.hh @@ -142,12 +142,16 @@ void unprotect_smob (SCM smob, SCM *prot_cons); extern bool parsed_objects_should_be_dead; +#ifndef NDEDUG #define ASSERT_LIVE_IS_ALLOWED() \ static bool passed_here_once;\ if (parsed_objects_should_be_dead && !passed_here_once) { \ - programming_error (string ("Parsed object should be dead: ") + __PRETTY_FUNCTION__ ); \ + ::programming_error (string ("Parsed object should be dead: ") + __PRETTY_FUNCTION__ ); \ passed_here_once = true;\ } +#else +#define ASSERT_LIVE_IS_ALLOWED() +#endif #endif /* SMOBS_HH */ diff --git a/lily/skyline.cc b/lily/skyline.cc index 744cceb4c3..b729e5312b 100644 --- a/lily/skyline.cc +++ b/lily/skyline.cc @@ -651,6 +651,7 @@ IMPLEMENT_DEFAULT_EQUAL_P (Skyline_pair); SCM Skyline::mark_smob (SCM) { + ASSERT_LIVE_IS_ALLOWED(); return SCM_EOL; } -- 2.39.5