diff --git a/eval/eval/regex_match_step.cc b/eval/eval/regex_match_step.cc index 3c949ee9f..4df758e76 100644 --- a/eval/eval/regex_match_step.cc +++ b/eval/eval/regex_match_step.cc @@ -66,6 +66,10 @@ class RegexMatchStep final : public ExpressionStepBase { } auto input_args = frame->value_stack().GetSpan(kNumRegexMatchArguments); const auto& subject = input_args[kRegexMatchStepSubject]; + if (subject.IsUnknown() || subject.IsError()) { + // Propagate unknowns and errors. + return; + } if (!subject->Is()) { frame->Abort(absl::InternalError( "First argument for regular expression match must be a string"));