File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -4823,11 +4823,12 @@ bool CodeGenFunction::isUnderlyingBasePointerConstantNull(const Expr *E) {
4823
4823
// Workaround for old glibc's __PTR_ALIGN macro
4824
4824
// If the condition can be constant evaluated, we check the selected arm.
4825
4825
if (auto *Select = dyn_cast<ConditionalOperator>(UnderlyingBaseExpr)) {
4826
- if ( auto *C = dyn_cast_if_present<llvm::Constant>(
4827
- ConstantEmitter (* this ). tryEmitAbstract (
4828
- Select-> getCond (), Select-> getCond ()-> getType ())))
4826
+ bool EvalResult;
4827
+ if (Select-> getCond ()-> EvaluateAsBooleanCondition (EvalResult,
4828
+ getContext ())) {
4829
4829
return isUnderlyingBasePointerConstantNull (
4830
- C->isNullValue () ? Select->getFalseExpr () : Select->getTrueExpr ());
4830
+ EvalResult ? Select->getTrueExpr () : Select->getFalseExpr ());
4831
+ }
4831
4832
}
4832
4833
return getContext ().isSentinelNullExpr (UnderlyingBaseExpr);
4833
4834
}
You can’t perform that action at this time.
0 commit comments