cb424d7448
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).
76 lines
2.1 KiB
Objective-C
76 lines
2.1 KiB
Objective-C
// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | FileCheck %s
|
|
|
|
// CHECK: @ArrayRecurs = internal global
|
|
// CHECK: @FUNC.ArrayRecurs = internal global
|
|
// CHECK: @FUNC.ArrayRecurs.1 = internal global
|
|
// CHECK: @FUNC1.ArrayRecurs = internal global
|
|
|
|
@class NSArray;
|
|
|
|
static NSArray *(^ArrayRecurs)(NSArray *addresses, unsigned long level) = ^(NSArray *addresses, unsigned long level) {
|
|
|
|
for(id rawAddress in addresses)
|
|
{
|
|
NSArray *separatedAddresses = ((NSArray*)0);
|
|
separatedAddresses = ArrayRecurs((NSArray *)rawAddress, level+1);
|
|
}
|
|
return (NSArray *)0;
|
|
};
|
|
|
|
extern NSArray *address;
|
|
extern unsigned long level;
|
|
|
|
void FUNC(void)
|
|
{
|
|
ArrayRecurs(address, level);
|
|
|
|
static NSArray *(^ArrayRecurs)(NSArray *addresses, unsigned long level) = ^(NSArray *addresses, unsigned long level) {
|
|
|
|
for(id rawAddress in addresses)
|
|
{
|
|
NSArray *separatedAddresses = ((NSArray*)0);
|
|
separatedAddresses = ArrayRecurs((NSArray *)rawAddress, level+1);
|
|
}
|
|
return (NSArray *)0;
|
|
};
|
|
ArrayRecurs(address, level);
|
|
|
|
if (ArrayRecurs) {
|
|
static NSArray *(^ArrayRecurs)(NSArray *addresses, unsigned long level) = ^(NSArray *addresses, unsigned long level) {
|
|
|
|
for(id rawAddress in addresses)
|
|
{
|
|
NSArray *separatedAddresses = ((NSArray*)0);
|
|
separatedAddresses = ArrayRecurs((NSArray *)rawAddress, level+1);
|
|
}
|
|
return (NSArray *)0;
|
|
};
|
|
ArrayRecurs(address, level);
|
|
}
|
|
}
|
|
|
|
void FUNC2(void) {
|
|
static void (^const block1)(int) = ^(int a){
|
|
if (a--)
|
|
block1(a);
|
|
};
|
|
}
|
|
|
|
// CHECK-LABEL: define{{.*}} void @FUNC2(
|
|
// CHECK: define internal void @_block_invoke{{.*}}(
|
|
// CHECK: call void %{{.*}}(ptr noundef @__block_literal_global{{.*}}, i32 noundef %{{.*}})
|
|
|
|
void FUNC1(void)
|
|
{
|
|
static NSArray *(^ArrayRecurs)(NSArray *addresses, unsigned long level) = ^(NSArray *addresses, unsigned long level) {
|
|
|
|
for(id rawAddress in addresses)
|
|
{
|
|
NSArray *separatedAddresses = ((NSArray*)0);
|
|
separatedAddresses = ArrayRecurs((NSArray *)rawAddress, level+1);
|
|
}
|
|
return (NSArray *)0;
|
|
};
|
|
ArrayRecurs(address, level);
|
|
}
|