Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Sarnie, Nick <[email protected]>
  • Loading branch information
sarnex committed Jan 10, 2025
1 parent 5f2366b commit 8b6e6c6
Show file tree
Hide file tree
Showing 75 changed files with 9,406 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.. title:: clang-tidy - clang-analyzer-cplusplus.PureVirtualCall

clang-analyzer-cplusplus.PureVirtualCall
========================================

Check pure virtual function calls during construction/destruction.

The clang-analyzer-cplusplus.PureVirtualCall check is an alias of
Clang Static Analyzer cplusplus.PureVirtualCall.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.. title:: clang-tidy - clang-analyzer-optin.osx.OSObjectCStyleCast

clang-analyzer-optin.osx.OSObjectCStyleCast
===========================================

Checker for C-style casts of OSObjects.

The clang-analyzer-optin.osx.OSObjectCStyleCast check is an alias of
Clang Static Analyzer optin.osx.OSObjectCStyleCast.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.. title:: clang-tidy - clang-analyzer-osx.MIG

clang-analyzer-osx.MIG
======================

Find violations of the Mach Interface Generator calling convention.

The clang-analyzer-osx.MIG check is an alias of
Clang Static Analyzer osx.MIG.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.. title:: clang-tidy - clang-analyzer-osx.OSObjectRetainCount

clang-analyzer-osx.OSObjectRetainCount
======================================

Check for leaks and improper reference count management for OSObject.

The clang-analyzer-osx.OSObjectRetainCount check is an alias of
Clang Static Analyzer osx.OSObjectRetainCount.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.. title:: clang-tidy - clang-analyzer-valist.CopyToSelf

clang-analyzer-valist.CopyToSelf
================================

Check for va_lists which are copied onto itself.

The clang-analyzer-valist.CopyToSelf check is an alias of
Clang Static Analyzer valist.CopyToSelf.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.. title:: clang-tidy - clang-analyzer-valist.Uninitialized

clang-analyzer-valist.Uninitialized
===================================

Check for usages of uninitialized (or already released) va_lists.

The clang-analyzer-valist.Uninitialized check is an alias of
Clang Static Analyzer valist.Uninitialized.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.. title:: clang-tidy - clang-analyzer-valist.Unterminated

clang-analyzer-valist.Unterminated
==================================

Check for va_lists which are not released by a va_end call.

The clang-analyzer-valist.Unterminated check is an alias of
Clang Static Analyzer valist.Unterminated.
20 changes: 20 additions & 0 deletions clang/test/Interpreter/crash.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// REQUIRES: host-supports-jit, x86_64-linux

// RUN: rm -rf %t
// RUN: mkdir -p %t
//
// RUN: split-file %s %t
//
// RUN: %clang++ -std=c++20 -fPIC -c %t/vec.cpp -o %t/vec.o
// RUN: %clang++ -shared %t/vec.o -o %t/vec.so
//
// RUN: cat %t/Test.cpp | LD_LIBRARY_PATH=%t:$LD_LIBRARY_PATH clang-repl

//--- vec.cpp
#include <vector>

//--- Test.cpp
%lib vec.so
#include <vector>
std::vector<int> v;
%quit
50 changes: 50 additions & 0 deletions compiler-rt/lib/builtins/aarch64/sme-abi-init.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

__attribute__((visibility("hidden"), nocommon))
_Bool __aarch64_has_sme_and_tpidr2_el0;

// We have multiple ways to check that the function has SME, depending on our
// target.
// * For Linux/Glibc we can use getauxval().
// * For Android we can use getauxval().
// * For newlib we can use __aarch64_sme_accessible().

#if defined(__linux__)

#if defined(__ANDROID__)
#include <sys/auxv.h>
#elif __has_include(<sys/auxv.h>)
#include <sys/auxv.h>
#else
#define getauxval(x) 0
#endif
#include "../cpu_model/aarch64/hwcap.inc"

static _Bool has_sme(void) { return getauxval(AT_HWCAP2) & HWCAP2_SME; }

#else // defined(__linux__)

#if defined(COMPILER_RT_SHARED_LIB)
__attribute__((weak))
#endif
extern _Bool __aarch64_sme_accessible(void);

static _Bool has_sme(void) {
#if defined(COMPILER_RT_SHARED_LIB)
if (!__aarch64_sme_accessible)
return 0;
#endif
return __aarch64_sme_accessible();
}

#endif // defined(__linux__)

#if __GNUC__ >= 9
#pragma GCC diagnostic ignored "-Wprio-ctor-dtor"
#endif
__attribute__((constructor(90)))
static void init_aarch64_has_sme(void) {
__aarch64_has_sme_and_tpidr2_el0 = has_sme();
}
91 changes: 91 additions & 0 deletions compiler-rt/test/msan/Linux/dn_expand.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
// RUN: %clangxx_msan %s -o %t && %run %t %p

#include <assert.h>
#include <resolv.h>
#include <string.h>

#include <sanitizer/msan_interface.h>

void testWrite() {
char unsigned input[] = {0xff, 0xc5, 0xf7, 0xff, 0x00, 0x00, 0xff, 0x0a, 0x00,
0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00,
0x10, 0x01, 0x05, 0x00, 0x01, 0x0a, 0x67, 0x6f, 0x6f,
0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x00};
char output[1024];

int res = dn_expand(input, input + sizeof(input), input + 23, output,
sizeof(output));

assert(res == 12);
assert(strcmp(output, "google\\.com") == 0);
__msan_check_mem_is_initialized(output, strlen(output) + 1);
}

void testWriteZeroLength() {
char unsigned input[] = {
0xff, 0xc5, 0xf7, 0xff, 0x00, 0x00, 0xff, 0x0a, 0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x10, 0x01, 0x05, 0x00, 0x01, 0x00,
};
char output[1024];

int res = dn_expand(input, input + sizeof(input), input + 23, output,
sizeof(output));

assert(res == 1);
assert(strcmp(output, "") == 0);
__msan_check_mem_is_initialized(output, strlen(output) + 1);
}

void testComp() {
char unsigned msg[1024];
char unsigned *mb = msg;
char unsigned *me = msg + sizeof(msg);
char unsigned **pb = (char unsigned **)mb;
pb[0] = msg;
pb[1] = nullptr;
mb += 64;
char unsigned **pe = (char unsigned **)mb;

char unsigned *n1 = mb;
int res = dn_comp("llvm.org", mb, me - mb, pb, pe);
assert(res == 10);
__msan_check_mem_is_initialized(mb, res);
// pb is [msg, llvm.org, nullptr]
__msan_check_mem_is_initialized(pb, sizeof(*pb) * 3);
mb += res;

char unsigned *n2 = mb;
res = dn_comp("lab.llvm.org", mb, me - mb, pb, pe);
assert(res == 6);
__msan_check_mem_is_initialized(mb, res);
// pb is [msg, llvm.org, lab.llvm.org, nullptr]
__msan_check_mem_is_initialized(pb, sizeof(*pb) * 4);
mb += res;

{
char output[1024];
res = dn_expand(msg, msg + sizeof(msg), n1, output, sizeof(output));

fprintf(stderr, "%d\n", res);
assert(res == 10);
assert(strcmp(output, "llvm.org") == 0);
__msan_check_mem_is_initialized(output, strlen(output) + 1);
}

{
char output[1024];
res = dn_expand(msg, msg + sizeof(msg), n2, output, sizeof(output));

assert(res == 6);
assert(strcmp(output, "lab.llvm.org") == 0);
__msan_check_mem_is_initialized(output, strlen(output) + 1);
}
}

int main(int iArgc, const char *szArgv[]) {
testWrite();
testWriteZeroLength();
testComp();

return 0;
}
4 changes: 2 additions & 2 deletions devops/scripts/install_drivers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ InstallIGFX () {
get_release oneapi-src/level-zero $L0_TAG \
| grep ".*$UBUNTU_VER.*deb" \
| wget -qi -
dpkg -i --force-overwrite *.deb && rm *.deb *.sum
dpkg -i --force-all *.deb && rm *.deb *.sum
mkdir -p /usr/local/lib/igc/
echo "$IGC_TAG" > /usr/local/lib/igc/IGCTAG.txt
if [ "$IS_IGC_DEV" == "Yes" ]; then
Expand All @@ -155,7 +155,7 @@ InstallIGFX () {
echo "Install IGC dev git hash $IGC_DEV_VER"
# New dev IGC packaged iga64 conflicting with iga64 from intel-igc-media
# force overwrite to workaround it first.
dpkg -i --force-overwrite *.deb
dpkg -i --force-all *.deb
echo "Install libopencl-clang"
# Workaround only, will download deb and install with dpkg once fixed.
cp -d libopencl-clang2.so.14* /usr/local/lib/
Expand Down
Loading

0 comments on commit 8b6e6c6

Please sign in to comment.