From cba1d02def7a84d79dc8b40506b661db0973ccf5 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 1 Apr 2010 15:15:45 -0700 Subject: [PATCH] PR9958: Let embedded-C assert guru mode * staptree.cxx (varuse_collecting_visitor::visit_embeddedcode): Don't allow calling /* guru */ functions unless guru mode is active. --- staptree.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/staptree.cxx b/staptree.cxx index bb8b62491..4e57ac181 100644 --- a/staptree.cxx +++ b/staptree.cxx @@ -1825,6 +1825,11 @@ varuse_collecting_visitor::visit_embeddedcode (embeddedcode *s) throw semantic_error ("function may not be used when --unprivileged is specified", current_function->tok); + // Don't allow /* guru */ functions unless -g is active. + if (!session.guru_mode && s->code.find ("/* guru */") != string::npos) + throw semantic_error ("function may not be used unless -g is specified", + current_function->tok); + // We want to elide embedded-C functions when possible. For // example, each $target variable access is expanded to an // embedded-C function call. Yet, for safety reasons, we should -- 2.43.5