]> git.donarmstrong.com Git - lilypond.git/commitdiff
Institutes property checks for non-event context property settings.
authorMike Solomon <mike@apollinemike.com>
Thu, 14 Jul 2011 20:02:49 +0000 (22:02 +0200)
committerNeil Puttock <n.puttock@gmail.com>
Mon, 1 Aug 2011 20:33:32 +0000 (21:33 +0100)
This fixes issue 1734 in addition to any potential incorrect settings
of properties in the layout block.  While this entails a property check
for all property settings in the ly/ folder, the time this takes is
negligible.
(cherry picked from commit a811a3c91c05f33474c1d447bedaa1e089522532)

lily/context.cc

index 758bcdfda881db504fee52e56319d0693089724c..3454ab1f1735fcc257ec58a46c46d0adc21c1e3f 100644 (file)
@@ -489,10 +489,13 @@ Context::instrumented_set_property (SCM sym, SCM val, const char *, int, const c
 void
 Context::internal_set_property (SCM sym, SCM val)
 {
+  bool type_check_ok = type_check_assignment (sym, val, ly_symbol2scm ("translation-type?"));
+
   if (do_internal_type_checking_global)
-    assert (type_check_assignment (sym, val, ly_symbol2scm ("translation-type?")));
+    assert (type_check_ok);
 
-  properties_dict ()->set (sym, val);
+  if (type_check_ok)
+    properties_dict ()->set (sym, val);
 }
 
 /*