Commit | Line | Data |
---|---|---|
5c30eb61 TGR |
1 | From: Tobias Geerinckx-Rice <me@tobias.gr> |
2 | Date: Wed, 20 May 2020 19:17:13 +0200 | |
3 | Subject: [PATCH] gnu: http-client: Fix assertion on armhf-linux. | |
4 | ||
5 | Copied verbatim from [0] to fix guix pull[1] on ARM systems. | |
6 | ||
7 | [0]: https://github.com/nodejs/http-parser/pull/510 | |
8 | [1]: https://issues.guix.gnu.org/40604 | |
9 | ||
10 | From 0e5868aebb9eb92b078d27bb2774c2154dc167e2 Mon Sep 17 00:00:00 2001 | |
11 | From: Ben Noordhuis <info@bnoordhuis.nl> | |
12 | Date: Thu, 30 Apr 2020 11:22:50 +0200 | |
13 | Subject: [PATCH] Fix sizeof(http_parser) assert | |
14 | ||
15 | The result should be 32 on both 32 bits and 64 bits architectures | |
16 | because of struct padding. | |
17 | ||
18 | Fixes: https://github.com/nodejs/http-parser/issues/507 | |
19 | --- | |
20 | test.c | 5 ++++- | |
21 | 1 file changed, 4 insertions(+), 1 deletion(-) | |
22 | ||
23 | diff --git a/test.c b/test.c | |
24 | index 7983424..f60a84f 100644 | |
25 | --- a/test.c | |
26 | +++ b/test.c | |
27 | @@ -4220,8 +4220,11 @@ main (void) | |
28 | patch = version & 255; | |
29 | printf("http_parser v%u.%u.%u (0x%06lx)\n", major, minor, patch, version); | |
30 | ||
31 | + /* Should be 32 on both 32 bits and 64 bits architectures because of | |
32 | + * struct padding, see https://github.com/nodejs/http-parser/issues/507. | |
33 | + */ | |
34 | printf("sizeof(http_parser) = %u\n", (unsigned int)sizeof(http_parser)); | |
35 | - assert(sizeof(http_parser) == 4 + 4 + 8 + 2 + 2 + 4 + sizeof(void *)); | |
36 | + assert(sizeof(http_parser) == 32); | |
37 | ||
38 | //// API | |
39 | test_preserve_data(); |