Skip to content

[analyzer] Fix crashing __builtin_bit_cast #139188

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 13, 2025

Conversation

ziqingluo-90
Copy link
Contributor

@ziqingluo-90 ziqingluo-90 commented May 9, 2025

I am investigating a CSA crash: https://godbolt.org/z/fEExYqoWM. If one changes the __builtin_bit_cast to a C-style cast, the test will be fine. So the problem is specific to __builtin_bit_cast.

Looking at the piece of code below, it seems that CSA handles __builtin_bit_cast just as an LValueToRValue cast. The actual operation of cast-to-target-type is missing.

void ExprEngine::VisitCast(const CastExpr *CastE, const Expr *Ex,
                           ExplodedNode *Pred, ExplodedNodeSet &Dst) {

  ExplodedNodeSet dstPreStmt;
  getCheckerManager().runCheckersForPreStmt(dstPreStmt, Pred, CastE, *this);

  if (CastE->getCastKind() == CK_LValueToRValue ||
      CastE->getCastKind() == CK_LValueToRValueBitCast) {
    for (ExplodedNode *subExprNode : dstPreStmt) {
      ProgramStateRef state = subExprNode->getState();
      const LocationContext *LCtx = subExprNode->getLocationContext();
      evalLoad(Dst, CastE, CastE, subExprNode, state, state->getSVal(Ex, LCtx));
    }
    return;
  }

The BuiltinBitCastExpr node always have the kind LValueToRValueBitCast. I suppose it is just associated to the second argument of a __builtin_bit_cast call.

-BuiltinBitCastExpr <col:17, col:45> 'void *' <LValueToRValueBitCast>

I'm trying to add the missing part.

Fixes #137417

Previously, CSA did not handle __builtin_bit_cast correctly. It
evaluated the LvalueToRvalue conversion for the casting expression,
but did not actually convert the value of the expression to be of the
destination type.
This commit fixes the problem.

rdar://149987320
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:static analyzer labels May 9, 2025
@llvmbot
Copy link
Member

llvmbot commented May 9, 2025

@llvm/pr-subscribers-clang

@llvm/pr-subscribers-clang-static-analyzer-1

Author: Ziqing Luo (ziqingluo-90)

Changes

I am investigating a CSA crash: https://godbolt.org/z/fEExYqoWM. If one changes the __builtin_bit_cast to a C-style cast, the test will be fine. So the problem is specific to __builtin_bit_cast.

Looking at the piece of code below, it seems that CSA handles __builtin_bit_cast just as an LValueToRValue cast. The actual operation of cast-to-target-type is missing.

void ExprEngine::VisitCast(const CastExpr *CastE, const Expr *Ex,
                           ExplodedNode *Pred, ExplodedNodeSet &amp;Dst) {

  ExplodedNodeSet dstPreStmt;
  getCheckerManager().runCheckersForPreStmt(dstPreStmt, Pred, CastE, *this);

  if (CastE-&gt;getCastKind() == CK_LValueToRValue ||
      CastE-&gt;getCastKind() == CK_LValueToRValueBitCast) {
    for (ExplodedNode *subExprNode : dstPreStmt) {
      ProgramStateRef state = subExprNode-&gt;getState();
      const LocationContext *LCtx = subExprNode-&gt;getLocationContext();
      evalLoad(Dst, CastE, CastE, subExprNode, state, state-&gt;getSVal(Ex, LCtx));
    }
    return;
  }

The BuiltinBitCastExpr node always have the kind LValueToRValueBitCast. I suppose it is just associated to the second argument of a __builtin_bit_cast call.

-BuiltinBitCastExpr &lt;col:17, col:45&gt; 'void *' &lt;LValueToRValueBitCast&gt;

I'm trying to add the missing part.


Full diff: https://github.com/llvm/llvm-project/pull/139188.diff

3 Files Affected:

  • (modified) clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp (+25-1)
  • (modified) clang/test/Analysis/builtin_bitcast.cpp (+12-2)
  • (modified) clang/test/Analysis/exercise-ps.c (+1-1)
diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp
index 3d0a69a515ab8..f2f640f459776 100644
--- a/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp
+++ b/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp
@@ -287,10 +287,34 @@ void ExprEngine::VisitCast(const CastExpr *CastE, const Expr *Ex,
 
   if (CastE->getCastKind() == CK_LValueToRValue ||
       CastE->getCastKind() == CK_LValueToRValueBitCast) {
+    ExplodedNodeSet dstEvalLoad;
+
     for (ExplodedNode *subExprNode : dstPreStmt) {
       ProgramStateRef state = subExprNode->getState();
       const LocationContext *LCtx = subExprNode->getLocationContext();
-      evalLoad(Dst, CastE, CastE, subExprNode, state, state->getSVal(Ex, LCtx));
+      evalLoad(dstEvalLoad, CastE, CastE, subExprNode, state,
+               state->getSVal(Ex, LCtx));
+    }
+    if (CastE->getCastKind() == CK_LValueToRValue) {
+      Dst.insert(dstEvalLoad);
+      return;
+    }
+    assert(CastE->getCastKind() == CK_LValueToRValueBitCast &&
+           "unexpected cast kind");
+    // Need to simulate the actual cast operation:
+    StmtNodeBuilder Bldr(dstEvalLoad, Dst, *currBldrCtx);
+
+    for (ExplodedNode *Node : dstEvalLoad) {
+      ProgramStateRef state = Node->getState();
+      const LocationContext *LCtx = Node->getLocationContext();
+      // getAsRegion should always be successful since Ex is an lvalue:
+      SVal OrigV = state->getSVal(state->getSVal(Ex, LCtx).getAsRegion());
+      SVal CastedV =
+          svalBuilder.evalCast(svalBuilder.simplifySVal(state, OrigV),
+                               CastE->getType(), Ex->getType());
+
+      state = state->BindExpr(CastE, LCtx, CastedV);
+      Bldr.generateNode(CastE, Node, state);
     }
     return;
   }
diff --git a/clang/test/Analysis/builtin_bitcast.cpp b/clang/test/Analysis/builtin_bitcast.cpp
index 5a0d9e7189b8e..9309ca7785a92 100644
--- a/clang/test/Analysis/builtin_bitcast.cpp
+++ b/clang/test/Analysis/builtin_bitcast.cpp
@@ -39,7 +39,7 @@ struct A {
   }
 };
 void gh_69922(size_t p) {
-  // expected-warning-re@+1 {{(reg_${{[0-9]+}}<size_t p>) & 1U}}
+  // expected-warning@+1 {{Unknown}}
   clang_analyzer_dump(__builtin_bit_cast(A*, p & 1));
 
   __builtin_bit_cast(A*, p & 1)->set(2); // no-crash
@@ -49,5 +49,15 @@ void gh_69922(size_t p) {
   // store to the member variable `n`.
 
   clang_analyzer_dump(__builtin_bit_cast(A*, p & 1)->n); // Ideally, this should print "2".
-  // expected-warning-re@-1 {{(reg_${{[0-9]+}}<size_t p>) & 1U}}
+  // expected-warning@-1 {{Unknown}}
+}
+
+namespace {
+  typedef unsigned long uintptr_t;
+  
+  bool previously_crash(const void *& ptr) {
+    clang_analyzer_dump(__builtin_bit_cast(void*, static_cast<uintptr_t>(-1)));
+    // expected-warning-re@-1 {{{{[0-9]+}} (Loc)}}
+    return ptr == __builtin_bit_cast(void*, static_cast<uintptr_t>(-1));
+  }
 }
diff --git a/clang/test/Analysis/exercise-ps.c b/clang/test/Analysis/exercise-ps.c
index 50643d5b04687..21d97a364e190 100644
--- a/clang/test/Analysis/exercise-ps.c
+++ b/clang/test/Analysis/exercise-ps.c
@@ -41,7 +41,7 @@ void f4(char *array) {
 
   _Static_assert(sizeof(int) == 4, "Wrong triple for the test");
 
-  clang_analyzer_dump_int(__builtin_bit_cast(int, b)); // expected-warning {{lazyCompoundVal}}
+  clang_analyzer_dump_int(__builtin_bit_cast(int, b)); // expected-warning {{Unknown}}
   clang_analyzer_dump_int(array[__builtin_bit_cast(int, b)]); // expected-warning {{Unknown}}
 
   array[__builtin_bit_cast(int, b)] = 0x10; // no crash

Copy link
Contributor

@NagyDonat NagyDonat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, thanks for fixing this crash!

I dropped one (somewhat paranoid) inline question.

Moreover, I would suggest following the coding standard and use UpperCamelCase for the variables that are freshly introduced (and perhaps also for the variables that were already existing, if you touch most references to them and could easily rename them). Unfortunately we cannot "jump to" this naming standard by globally renaming many variables (because that would heavily pollute the git history), but I think we should gradually transition by following the standard in new variables and perhaps renaming the variables in the code that we touch. (As a personal preference, I consistently update the variable names when I edit some code, but objectively it's also OK to keep the old names to preserve consistency with adjacent existing code.)

Copy link
Contributor

@steakhal steakhal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall. Thank you!
I'm also in favor of following the LLVM coding style.

@ziqingluo-90
Copy link
Contributor Author

Thanks for reviewing!

@ziqingluo-90
Copy link
Contributor Author

This fix should solve #71174, and #137417

Copy link
Contributor

@steakhal steakhal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@steakhal steakhal changed the title [StaticAnalyzer] Handle __builtin_bit_cast [analyzer] Fix crashing __builtin_bit_cast May 12, 2025
Copy link
Contributor

@steakhal steakhal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still LGTM.

@ziqingluo-90 ziqingluo-90 merged commit 4122958 into llvm:main May 13, 2025
11 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented May 13, 2025

LLVM Buildbot has detected a new failure on builder fuchsia-x86_64-linux running on fuchsia-debian-64-us-central1-b-1 while building clang at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/11/builds/15055

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/fuchsia-linux.py ...' (failure)
...
[260/2500] Building CXX object libc/src/strings/CMakeFiles/libc.src.strings.bcopy.dir/bcopy.cpp.obj
[261/2500] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.common_constants.dir/common_constants.cpp.obj
[262/2500] Building CXX object libc/src/ctype/CMakeFiles/libc.src.ctype.isdigit_l.dir/isdigit_l.cpp.obj
[263/2500] Building CXX object libc/src/ctype/CMakeFiles/libc.src.ctype.isupper_l.dir/isupper_l.cpp.obj
[264/2500] Building CXX object libc/src/ctype/CMakeFiles/libc.src.ctype.isspace_l.dir/isspace_l.cpp.obj
[265/2500] Building CXX object libc/src/ctype/CMakeFiles/libc.src.ctype.ispunct_l.dir/ispunct_l.cpp.obj
[266/2500] Building CXX object libc/src/ctype/CMakeFiles/libc.src.ctype.iscntrl_l.dir/iscntrl_l.cpp.obj
[267/2500] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.issignaling.dir/issignaling.cpp.obj
[268/2500] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.issignalingf.dir/issignalingf.cpp.obj
[269/2500] Building CXX object libc/src/stdlib/CMakeFiles/libc.src.stdlib.l64a.dir/l64a.cpp.obj
FAILED: libc/src/stdlib/CMakeFiles/libc.src.stdlib.l64a.dir/l64a.cpp.obj 
/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-qnatqx0o/./bin/clang++ --target=riscv32-unknown-elf -DLIBC_NAMESPACE=__llvm_libc_21_0_0_git -I/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc -isystem /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-qnatqx0o/include/riscv32-unknown-unknown-elf --target=riscv32-unknown-elf -march=rv32imafc -mabi=ilp32f -Wno-atomic-alignment "-Dvfprintf(stream, format, vlist)=vprintf(format, vlist)" "-Dfprintf(stream, format, ...)=printf(format)" -D_LIBCPP_PRINT=1 -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wno-unnecessary-virtual-specifier -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -ffunction-sections -fdata-sections -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-qnatqx0o/runtimes/runtimes-riscv32-unknown-elf-bins=../../../../llvm-project -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/= -no-canonical-prefixes -Os -DNDEBUG --target=riscv32-unknown-elf -DLIBC_QSORT_IMPL=LIBC_QSORT_HEAP_SORT -DLIBC_ADD_NULL_CHECKS "-DLIBC_MATH=(LIBC_MATH_SKIP_ACCURATE_PASS | LIBC_MATH_SMALL_TABLES)" -fpie -ffreestanding -DLIBC_FULL_BUILD -nostdlibinc -ffixed-point -fno-builtin -fno-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -Wdeprecated -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -DLIBC_COPT_PUBLIC_PACKAGING -MD -MT libc/src/stdlib/CMakeFiles/libc.src.stdlib.l64a.dir/l64a.cpp.obj -MF libc/src/stdlib/CMakeFiles/libc.src.stdlib.l64a.dir/l64a.cpp.obj.d -o libc/src/stdlib/CMakeFiles/libc.src.stdlib.l64a.dir/l64a.cpp.obj -c /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/stdlib/l64a.cpp
In file included from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/stdlib/l64a.cpp:13:
In file included from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/libc_assert.h:25:
In file included from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/integer_to_string.h:70:
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/big_int.h:35:31: error: use of undeclared identifier 'uint16_t'
   35 | template <> struct half_width<uint16_t> : cpp::type_identity<uint8_t> {};
      |                               ^~~~~~~~
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/big_int.h:35:62: error: use of undeclared identifier 'uint8_t'
   35 | template <> struct half_width<uint16_t> : cpp::type_identity<uint8_t> {};
      |                                                              ^~~~~~~
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/big_int.h:36:31: error: use of undeclared identifier 'uint32_t'
   36 | template <> struct half_width<uint32_t> : cpp::type_identity<uint16_t> {};
      |                               ^~~~~~~~
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/big_int.h:36:62: error: use of undeclared identifier 'uint16_t'
   36 | template <> struct half_width<uint32_t> : cpp::type_identity<uint16_t> {};
      |                                                              ^~~~~~~~
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/big_int.h:81:38: error: use of undeclared identifier 'uint8_t'
   81 |   if constexpr (cpp::is_same_v<word, uint8_t>) {
      |                                      ^~~~~~~
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/big_int.h:82:18: error: use of undeclared identifier 'uint16_t'
   82 |     return split<uint16_t>(uint16_t(a) * uint16_t(b));
      |                  ^~~~~~~~
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/big_int.h:83:45: error: use of undeclared identifier 'uint16_t'
   83 |   } else if constexpr (cpp::is_same_v<word, uint16_t>) {
      |                                             ^~~~~~~~
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/big_int.h:84:18: error: use of undeclared identifier 'uint32_t'
   84 |     return split<uint32_t>(uint32_t(a) * uint32_t(b));
      |                  ^~~~~~~~
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/big_int.h:332:57: error: unknown type name 'uint64_t'
  332 | template <size_t Bits, bool Signed, typename WordType = uint64_t>
      |                                                         ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/big_int.h:643:36: error: unknown type name 'uint64_t'
  643 |   LIBC_INLINE constexpr void pow_n(uint64_t power) {
      |                                    ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/big_int.h:1066:31: error: use of undeclared identifier 'uint32_t'
 1066 |                               uint32_t
      |                               ^~~~~~~~
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/big_int.h:1071:62: error: use of undeclared identifier 'uint16_t'
Step 6 (build) failure: build (failure)
...
[260/2500] Building CXX object libc/src/strings/CMakeFiles/libc.src.strings.bcopy.dir/bcopy.cpp.obj
[261/2500] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.common_constants.dir/common_constants.cpp.obj
[262/2500] Building CXX object libc/src/ctype/CMakeFiles/libc.src.ctype.isdigit_l.dir/isdigit_l.cpp.obj
[263/2500] Building CXX object libc/src/ctype/CMakeFiles/libc.src.ctype.isupper_l.dir/isupper_l.cpp.obj
[264/2500] Building CXX object libc/src/ctype/CMakeFiles/libc.src.ctype.isspace_l.dir/isspace_l.cpp.obj
[265/2500] Building CXX object libc/src/ctype/CMakeFiles/libc.src.ctype.ispunct_l.dir/ispunct_l.cpp.obj
[266/2500] Building CXX object libc/src/ctype/CMakeFiles/libc.src.ctype.iscntrl_l.dir/iscntrl_l.cpp.obj
[267/2500] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.issignaling.dir/issignaling.cpp.obj
[268/2500] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.issignalingf.dir/issignalingf.cpp.obj
[269/2500] Building CXX object libc/src/stdlib/CMakeFiles/libc.src.stdlib.l64a.dir/l64a.cpp.obj
FAILED: libc/src/stdlib/CMakeFiles/libc.src.stdlib.l64a.dir/l64a.cpp.obj 
/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-qnatqx0o/./bin/clang++ --target=riscv32-unknown-elf -DLIBC_NAMESPACE=__llvm_libc_21_0_0_git -I/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc -isystem /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-qnatqx0o/include/riscv32-unknown-unknown-elf --target=riscv32-unknown-elf -march=rv32imafc -mabi=ilp32f -Wno-atomic-alignment "-Dvfprintf(stream, format, vlist)=vprintf(format, vlist)" "-Dfprintf(stream, format, ...)=printf(format)" -D_LIBCPP_PRINT=1 -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wno-unnecessary-virtual-specifier -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -ffunction-sections -fdata-sections -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-qnatqx0o/runtimes/runtimes-riscv32-unknown-elf-bins=../../../../llvm-project -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/= -no-canonical-prefixes -Os -DNDEBUG --target=riscv32-unknown-elf -DLIBC_QSORT_IMPL=LIBC_QSORT_HEAP_SORT -DLIBC_ADD_NULL_CHECKS "-DLIBC_MATH=(LIBC_MATH_SKIP_ACCURATE_PASS | LIBC_MATH_SMALL_TABLES)" -fpie -ffreestanding -DLIBC_FULL_BUILD -nostdlibinc -ffixed-point -fno-builtin -fno-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -Wdeprecated -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -DLIBC_COPT_PUBLIC_PACKAGING -MD -MT libc/src/stdlib/CMakeFiles/libc.src.stdlib.l64a.dir/l64a.cpp.obj -MF libc/src/stdlib/CMakeFiles/libc.src.stdlib.l64a.dir/l64a.cpp.obj.d -o libc/src/stdlib/CMakeFiles/libc.src.stdlib.l64a.dir/l64a.cpp.obj -c /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/stdlib/l64a.cpp
In file included from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/stdlib/l64a.cpp:13:
In file included from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/libc_assert.h:25:
In file included from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/integer_to_string.h:70:
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/big_int.h:35:31: error: use of undeclared identifier 'uint16_t'
   35 | template <> struct half_width<uint16_t> : cpp::type_identity<uint8_t> {};
      |                               ^~~~~~~~
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/big_int.h:35:62: error: use of undeclared identifier 'uint8_t'
   35 | template <> struct half_width<uint16_t> : cpp::type_identity<uint8_t> {};
      |                                                              ^~~~~~~
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/big_int.h:36:31: error: use of undeclared identifier 'uint32_t'
   36 | template <> struct half_width<uint32_t> : cpp::type_identity<uint16_t> {};
      |                               ^~~~~~~~
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/big_int.h:36:62: error: use of undeclared identifier 'uint16_t'
   36 | template <> struct half_width<uint32_t> : cpp::type_identity<uint16_t> {};
      |                                                              ^~~~~~~~
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/big_int.h:81:38: error: use of undeclared identifier 'uint8_t'
   81 |   if constexpr (cpp::is_same_v<word, uint8_t>) {
      |                                      ^~~~~~~
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/big_int.h:82:18: error: use of undeclared identifier 'uint16_t'
   82 |     return split<uint16_t>(uint16_t(a) * uint16_t(b));
      |                  ^~~~~~~~
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/big_int.h:83:45: error: use of undeclared identifier 'uint16_t'
   83 |   } else if constexpr (cpp::is_same_v<word, uint16_t>) {
      |                                             ^~~~~~~~
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/big_int.h:84:18: error: use of undeclared identifier 'uint32_t'
   84 |     return split<uint32_t>(uint32_t(a) * uint32_t(b));
      |                  ^~~~~~~~
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/big_int.h:332:57: error: unknown type name 'uint64_t'
  332 | template <size_t Bits, bool Signed, typename WordType = uint64_t>
      |                                                         ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/big_int.h:643:36: error: unknown type name 'uint64_t'
  643 |   LIBC_INLINE constexpr void pow_n(uint64_t power) {
      |                                    ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/big_int.h:1066:31: error: use of undeclared identifier 'uint32_t'
 1066 |                               uint32_t
      |                               ^~~~~~~~
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/big_int.h:1071:62: error: use of undeclared identifier 'uint16_t'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:static analyzer clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Static analyzer crashes using std::bit_cast expression
5 participants