Files
RedBear-OS/local/recipes/dev/libclc/source/compiler-rt/test/tysan/struct-offset-different-base.cpp
T
vasilito cb424d7448 build: static patch-sanity linter (shift-left the malformed-patch class)
verify-patch-sanity.py validates every active recipe .patch has internally-
consistent hunk line counts — catching the 'malformed patch at line N' failure
at commit/CI/preflight time instead of hours into a cook. This cycle hit that
class three times (qtwaylandscanner, sddm, xwayland), each only discovered when
cookbook tried to apply the patch.

Running it across the repo found 29 latent malformed patches (validated against
GNU patch: e.g. relibc/P3-sysv-ipc reproduces 'malformed patch at line 22').
They were harmless only because they sit in vendored recipes (baked, not re-
applied) — but would fail on any version-bump re-derivation. --fix recounts the
hunk headers (body untouched) and repaired all 29.

Wired into build-preflight.sh (Phase 1.0D) and redbear-ci.yml, with a unit test
(test-patch-sanity.sh). Skips archived/legacy trees and unvalidatable formats
(empty placeholders, bare-@@ git hunks).
2026-08-01 05:13:02 +03:00

50 lines
952 B
C++

// RUN: %clangxx_tysan -O0 %s -o %t && %run %t >%t.out 2>&1
// RUN: FileCheck %s --implicit-check-not ERROR < %t.out
// Modified reproducer from https://github.com/llvm/llvm-project/issues/105960
#include <stdio.h>
struct inner1 {
char buffer;
int i;
};
struct inner2 {
char buffer;
int i;
float endBuffer;
};
void init_inner1(inner1 *iPtr) { iPtr->i = 200; }
void init_inner2(inner2 *iPtr) {
iPtr->i = 400;
iPtr->endBuffer = 413.0f;
}
struct outer {
inner1 foo;
inner2 bar;
char buffer;
};
int main(void) {
outer *l = new outer();
init_inner1(&l->foo);
init_inner2(&l->bar);
int access = l->foo.i;
printf("Accessed value 1 is %d\n", access);
access = l->bar.i;
printf("Accessed value 2 is %d\n", access);
float fAccess = l->bar.endBuffer;
printf("Accessed value 3 is %f\n", fAccess);
return 0;
}
// CHECK: Accessed value 1 is 200
// CHECK: Accessed value 2 is 400
// CHECK: Accessed value 3 is 413.0