[Lldb-commits] [lldb] r320021 - Variable: Fix usage of uninitialised value

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Thu Dec 7 02:38:22 PST 2017


Author: labath
Date: Thu Dec  7 02:38:22 2017
New Revision: 320021

URL: http://llvm.org/viewvc/llvm-project?rev=320021&view=rev
Log:
Variable: Fix usage of uninitialised value

Summary:
Variable::GetValuesForVariableExpressionPath was passing an
uninitialised value for the final_task_on_target argument. On my
compiler/optimization level combo, the final_task_on_target happened to
contain "dereference" in some circumstances, which produced hilarious
results. The same is true for other arguments to the
GetValueForExpressionPath call.

The correct behavior here seems to be to just omit the arguments
altogether and let the default behavior take place.

Reviewers: jingham

Subscribers: mehdi_amini, lldb-commits

Differential Revision: https://reviews.llvm.org/D40557

Modified:
    lldb/trunk/source/Symbol/Variable.cpp

Modified: lldb/trunk/source/Symbol/Variable.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Variable.cpp?rev=320021&r1=320020&r2=320021&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Variable.cpp (original)
+++ lldb/trunk/source/Symbol/Variable.cpp Thu Dec  7 02:38:22 2017
@@ -425,14 +425,8 @@ Status Variable::GetValuesForVariableExp
       llvm::StringRef variable_sub_expr_path =
           variable_expr_path.drop_front(variable_name.size());
       if (!variable_sub_expr_path.empty()) {
-        ValueObject::ExpressionPathScanEndReason reason_to_stop;
-        ValueObject::ExpressionPathEndResultType final_value_type;
-        ValueObject::GetValueForExpressionPathOptions options;
-        ValueObject::ExpressionPathAftermath final_task_on_target;
-
         valobj_sp = variable_valobj_sp->GetValueForExpressionPath(
-            variable_sub_expr_path, &reason_to_stop, &final_value_type, options,
-            &final_task_on_target);
+            variable_sub_expr_path);
         if (!valobj_sp) {
           error.SetErrorStringWithFormat(
               "invalid expression path '%s' for variable '%s'",




More information about the lldb-commits mailing list