Reviewers: ,
Message:
I tried this with my local branch and I noticed no slow-down (I'm sure
there is one, but it certainly is not prohibitive). It gets rid of any
potential segfaults from bad property sets in the layout block.
I realize now that all \set calls are, in fact, events and thus go
through a different function (set_property_from_event) that does this
type checking.
Cheers,
MS
Description:
Does type checking for all context property sets.
Please review this at http://codereview.appspot.com/4654090/
Affected files:
M lily/context.cc
Index: lily/context.cc
diff --git a/lily/context.cc b/lily/context.cc
index
4dbb6e5657721e436dc4f52227d24409c62a53e8..5ade53aa8ef1290cecedffff3e790bb9c1b8ff53
100644
--- a/lily/context.cc
+++ b/lily/context.cc
@@ -490,10 +490,10 @@ Context::instrumented_set_property (SCM sym, SCM val,
const char*, int, const ch
void
Context::internal_set_property (SCM sym, SCM val)
{
- if (do_internal_type_checking_global)
- assert (type_check_assignment (sym, val, ly_symbol2scm
("translation-type?")));
+ bool ok = type_check_assignment (sym, val, ly_symbol2scm
("translation-type?"));
- properties_dict ()->set (sym, val);
+ if (ok)
+ properties_dict ()->set (sym, val);
}
/*
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel