From 8848abe69fa957d5406659229cecdada83da8421 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 22 Oct 2015 12:35:08 +0200 Subject: QML: Sanitize reading environment variables. Where possible, use qEnvironmentVariableIsSet()/ qEnvironmentVariableIsEmpty() instead of checking on the return value of qgetenv(). Where the value is required, add a check using one of qEnvironmentVariableIsSet()/Empty(). Change-Id: Ia8b7534e6f5165bd8a6b4e63ccc139c42dd03056 Reviewed-by: Lars Knoll --- src/qml/jit/qv4regalloc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/qml/jit/qv4regalloc.cpp') diff --git a/src/qml/jit/qv4regalloc.cpp b/src/qml/jit/qv4regalloc.cpp index b9178c0ea0..e980f181c2 100644 --- a/src/qml/jit/qv4regalloc.cpp +++ b/src/qml/jit/qv4regalloc.cpp @@ -1323,7 +1323,7 @@ void RegisterAllocator::run(IR::Function *function, const Optimizer &opt) if (DebugRegAlloc) qDebug() << "*** Finished regalloc , result:"; - static bool showCode = !qgetenv("QV4_SHOW_IR").isNull(); + static const bool showCode = qEnvironmentVariableIsSet("QV4_SHOW_IR"); if (showCode) { QBuffer buf; buf.open(QIODevice::WriteOnly); -- cgit v1.2.3