Skip to content

Commit 85283a8

Browse files
author
git apple-llvm automerger
committed
Merge commit '5e67eeecf5f4' from swift/release/6.0 into stable/20230725
2 parents 6779d56 + 5e67eee commit 85283a8

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

lldb/source/Expression/UserExpression.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,8 @@ UserExpression::Evaluate(ExecutionContext &exe_ctx,
310310
target->GetUserExpressionForLanguage(
311311
fixed_expression->c_str(), full_prefix, language, desired_type,
312312
options, ctx_obj, error));
313+
if (!fixed_expression_sp)
314+
break;
313315
DiagnosticManager fixed_diagnostic_manager;
314316
parse_success = fixed_expression_sp->Parse(
315317
fixed_diagnostic_manager, exe_ctx, execution_policy,
@@ -318,17 +320,16 @@ UserExpression::Evaluate(ExecutionContext &exe_ctx,
318320
diagnostic_manager.Clear();
319321
user_expression_sp = fixed_expression_sp;
320322
break;
323+
}
324+
// The fixed expression also didn't parse. Let's check for any new
325+
// fixits we could try.
326+
if (!fixed_expression_sp->GetFixedText().empty()) {
327+
*fixed_expression = fixed_expression_sp->GetFixedText().str();
321328
} else {
322-
// The fixed expression also didn't parse. Let's check for any new
323-
// Fix-Its we could try.
324-
if (!fixed_expression_sp->GetFixedText().empty()) {
325-
*fixed_expression = fixed_expression_sp->GetFixedText().str();
326-
} else {
327-
// Fixed expression didn't compile without a fixit, don't retry and
328-
// don't tell the user about it.
329-
fixed_expression->clear();
330-
break;
331-
}
329+
// Fixed expression didn't compile without a fixit, don't retry and
330+
// don't tell the user about it.
331+
fixed_expression->clear();
332+
break;
332333
}
333334
}
334335
}

0 commit comments

Comments
 (0)