[clang] [clang][bytecode] Fix unknown size arrays crash in clang bytecode (PR #160015)
Mariya Podchishchaeva via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 22 02:09:11 PDT 2025
================
@@ -245,6 +245,11 @@ bool Context::evaluateStrlen(State &Parent, const Expr *E, uint64_t &Result) {
if (!FieldDesc->isPrimitiveArray())
return false;
+ // Handle unknown size arrays - we can't determine the length at compile time
+ if (Ptr.isUnknownSizeArray()) {
+ return false;
+ }
----------------
Fznamznon wrote:
A code style nit
```suggestion
if (Ptr.isUnknownSizeArray())
return false;
```
https://github.com/llvm/llvm-project/pull/160015
More information about the cfe-commits
mailing list