Clean up more code

- Found some bugs in LLVM compiler-rt library
- The useless LIBC_STUBS package is now deleted
- Improve the overflow checking story even further
- Get chibicc tests working in MODE=dbg mode again
- The libc/isystem/ headers now have correctly named guards
This commit is contained in:
Justine Tunney 2023-06-18 00:55:09 -07:00
parent afc58a8b41
commit d7c79f43ef
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
294 changed files with 912 additions and 1208 deletions

View file

@ -25,7 +25,7 @@
* Collapses repeating headers onto a single line.
*/
char *FoldHeader(struct HttpMessage *msg, char *b, int h, size_t *z) {
char *p;
char *p, *p2;
size_t i, n, m;
struct HttpHeader *x;
n = msg->headers[h].b - msg->headers[h].a;
@ -35,9 +35,13 @@ char *FoldHeader(struct HttpMessage *msg, char *b, int h, size_t *z) {
x = msg->xheaders.p + i;
if (GetHttpHeader(b + x->k.a, x->k.b - x->k.a) == h) {
m = x->v.b - x->v.a;
if (!(p = realloc(p, n + 2 + m))) abort();
memcpy(mempcpy(p + n, ", ", 2), b + x->v.a, m);
n += 2 + m;
if ((p2 = realloc(p, n + 2 + m))) {
memcpy(mempcpy((p = p2) + n, ", ", 2), b + x->v.a, m);
n += 2 + m;
} else {
free(p);
return 0;
}
}
}
*z = n;

View file

@ -22,7 +22,6 @@ NET_HTTP_A_DIRECTDEPS = \
LIBC_MEM \
LIBC_NEXGEN32E \
LIBC_STR \
LIBC_STUBS \
LIBC_SYSV \
LIBC_TIME