Merge pull request #7529 from Icinga/bugfix/activestageoverride-7521

WarnOnImplicitlySetGlobalVar(): warn only on sins inside actual DSL code
This commit is contained in:
Michael Friedrich 2019-09-25 12:11:26 +02:00 committed by GitHub
commit 4e23f954fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -560,7 +560,7 @@ void WarnOnImplicitlySetGlobalVar(const std::unique_ptr<Expression>& setLhs, con
if (var && setLhsParent.IsObject()) { if (var && setLhsParent.IsObject()) {
auto ns (dynamic_pointer_cast<Namespace>(setLhsParent.Get<Object::Ptr>())); auto ns (dynamic_pointer_cast<Namespace>(setLhsParent.Get<Object::Ptr>()));
if (ns && ns == ScriptGlobal::GetGlobals()) { if (ns && ns == ScriptGlobal::GetGlobals() && debug.Path.GetLength()) {
const char *opStr = nullptr; const char *opStr = nullptr;
switch (setOp) { switch (setOp) {