================
@@ -290,34 +290,29 @@ UserExpression::Evaluate(ExecutionContext &exe_ctx,
// If there is a fixed expression, try to parse it:
if (!parse_success) {
- // Delete the expression that failed to parse before attempting to parse
- // the next expression.
- user_expression_sp.reset();
-
execution_results = lldb::eExpressionParseError;
if (!fixed_expression->empty() && options.GetAutoApplyFixIts()) {
const uint64_t max_fix_retries = options.GetRetriesWithFixIts();
for (uint64_t i = 0; i < max_fix_retries; ++i) {
// Try parsing the fixed expression.
- lldb::UserExpressionSP fixed_expression_sp(
- target->GetUserExpressionForLanguage(
- fixed_expression->c_str(), full_prefix, language, desired_type,
- options, ctx_obj, error));
- if (!fixed_expression_sp)
+ user_expression_sp.reset(target->GetUserExpressionForLanguage(
+ fixed_expression->c_str(), full_prefix, language, desired_type,
+ options, ctx_obj, error));
----------------
JDevlieghere wrote:
Any reason to call reset and not copy-assign? Seems more canonical.
```suggestion
user_expression_sp = target->GetUserExpressionForLanguage(
fixed_expression->c_str(), full_prefix, language, desired_type,
options, ctx_obj, error);
```
https://github.com/llvm/llvm-project/pull/177921
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits