diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-12-08 23:51:32 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-12-09 10:33:25 +0000 |
commit | 67664c51c7fb24f3404557c3d7c8de03ee438460 (patch) | |
tree | e2af3dc9b9e7ba2bad3c934a0d48abd96dbaed24 /meta | |
parent | 8231454281bb2ed01dce606fc3f6347cc5cea879 (diff) | |
download | poky-67664c51c7fb24f3404557c3d7c8de03ee438460.tar.gz |
puzzles: Refresh patches based upon upstream discussion
I mentioned these patches to upstream and this cleans them up based upon
our discussion with better fixes, fixed comments and tracking down the correct
issue in the malloc case.
If we can test and confirm them in this form, we should be in a good position
to resovle the issues with upstream and be able to drop the patches ultimately.
(From OE-Core rev: 87e6a2715b1dcd5b03d9d6eb0fd0feacc5710e7a)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
6 files changed, 148 insertions, 164 deletions
diff --git a/meta/recipes-sato/puzzles/files/0001-malloc-Check-for-excessive-values-to-malloc.patch b/meta/recipes-sato/puzzles/files/0001-malloc-Check-for-excessive-values-to-malloc.patch index 66af6afa2f..b572b55d1c 100644 --- a/meta/recipes-sato/puzzles/files/0001-malloc-Check-for-excessive-values-to-malloc.patch +++ b/meta/recipes-sato/puzzles/files/0001-malloc-Check-for-excessive-values-to-malloc.patch | |||
@@ -1,49 +1,45 @@ | |||
1 | From 1c01a5bc9ac7f8aaa484b1a8e0e74aa5f8899d0e Mon Sep 17 00:00:00 2001 | 1 | tree234: Avoid excessive values to malloc |
2 | From: Khem Raj <raj.khem@gmail.com> | 2 | |
3 | Date: Sun, 8 Nov 2020 11:17:59 -0800 | 3 | with whole program optimizers like lto, smalloc() is inlined the excessive |
4 | Subject: [PATCH] malloc: Check for excessive values to malloc | 4 | constant argument is propagated to malloc() and ultimately triggers the warning. |
5 | 5 | ||
6 | with whole program optimizers like lto smalloc() | 6 | | tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/git/tree234.c: In function 'disptree': |
7 | is inlined the excessive constant argument is propagated to | 7 | | tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/git/tree234.c:46:17: error: argument 1 value '18446744073709551612' exceeds maximum object size 9223372036854775807 [-Werror=alloc-size-larger-than=] |
8 | malloc() and ultimately triggers the warning. | 8 | | 46 | #define smalloc malloc |
9 | 9 | | | ^ | |
10 | malloc.c:15:9: error: argument 1 range [18446744065119617024, 18446744073709551580] exceeds maximum object size 9223372036854775807 [-Werror=alloc-size-larger-than=] | 10 | | tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/git/tree234.c:1631:17: note: in expansion of macro 'smalloc' |
11 | 11 | | 1631 | leveldata = smalloc(ht * (width+2)); | |
12 | therefore add a check before excessive constant argument before calling | 12 | | | ^~~~~~~ |
13 | malloc | 13 | | In file included from tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/git/tree234.c:29: |
14 | 14 | | tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/recipe-sysroot/usr/include/stdlib.h:539:14: note: in a call to allocation function 'malloc' declared here | |
15 | Note that this will not happen with normal compile since they happen to | 15 | | 539 | extern void *malloc (size_t __size) __THROW __attribute_malloc__ |
16 | be in different translation units and compiler can not semantically | 16 | | | ^~~~~~ |
17 | analyze as much | 17 | | tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/git/tree234.c:46:17: error: argument 1 value '18446744073709551600' exceeds maximum object size 9223372036854775807 [-Werror=alloc-size-larger-than=] |
18 | 18 | | 46 | #define smalloc malloc | |
19 | Upstream-Status: Pending | 19 | | | ^ |
20 | 20 | | tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/git/tree234.c:1632:18: note: in expansion of macro 'smalloc' | |
21 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 21 | | 1632 | ctx.levels = smalloc(ht * sizeof(char *)); |
22 | --- | 22 | | | ^~~~~~~ |
23 | malloc.c | 3 +++ | 23 | | In file included from tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/git/tree234.c:29: |
24 | 1 file changed, 3 insertions(+) | 24 | | tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/recipe-sysroot/usr/include/stdlib.h:539:14: note: in a call to allocation function 'malloc' declared here |
25 | 25 | | 539 | extern void *malloc (size_t __size) __THROW __attribute_malloc__ | |
26 | diff --git a/malloc.c b/malloc.c | 26 | | | ^~~~~~ |
27 | index a7fa7c5..520377c 100644 | 27 | | cc1: some warnings being treated as errors |
28 | --- a/malloc.c | 28 | |
29 | +++ b/malloc.c | 29 | Upstream-Status: Submitted [email discussion with upstream] |
30 | @@ -2,6 +2,7 @@ | 30 | |
31 | * malloc.c: safe wrappers around malloc, realloc, free, strdup | 31 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> |
32 | */ | 32 | |
33 | Index: git/tree234.c | ||
34 | =================================================================== | ||
35 | --- git.orig/tree234.c | ||
36 | +++ git/tree234.c | ||
37 | @@ -1621,7 +1621,7 @@ void disptree(tree234 *t) { | ||
38 | dispctx ctx; | ||
39 | char *leveldata; | ||
40 | int width = count234(t); | ||
41 | - int ht = height234(t) * 3 - 2; | ||
42 | + unsigned int ht = height234(t) * 3 - 2; | ||
43 | int i; | ||
33 | 44 | ||
34 | +#include <stdint.h> | 45 | if (!t->root) { |
35 | #include <stdlib.h> | ||
36 | #include <string.h> | ||
37 | #include "puzzles.h" | ||
38 | @@ -12,6 +13,8 @@ | ||
39 | */ | ||
40 | void *smalloc(size_t size) { | ||
41 | void *p; | ||
42 | + if (size > PTRDIFF_MAX) | ||
43 | + fatal("exceeds maximum object size"); | ||
44 | p = malloc(size); | ||
45 | if (!p) | ||
46 | fatal("out of memory"); | ||
47 | -- | ||
48 | 2.29.2 | ||
49 | |||
diff --git a/meta/recipes-sato/puzzles/files/0001-map-Fix-stringop-overflow-warning.patch b/meta/recipes-sato/puzzles/files/0001-map-Fix-stringop-overflow-warning.patch index a02d8732ab..7f46d3ec0e 100644 --- a/meta/recipes-sato/puzzles/files/0001-map-Fix-stringop-overflow-warning.patch +++ b/meta/recipes-sato/puzzles/files/0001-map-Fix-stringop-overflow-warning.patch | |||
@@ -1,7 +1,5 @@ | |||
1 | From 3d78d4cffcdc1242892b6c21c26d1c96938c48d1 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | 1 | From: Khem Raj <raj.khem@gmail.com> |
3 | Date: Sat, 27 Feb 2021 10:02:43 -0800 | 2 | map: Fix stringop-overflow warning |
4 | Subject: [PATCH] map: Fix stringop-overflow warning | ||
5 | 3 | ||
6 | Fixes | 4 | Fixes |
7 | 5 | ||
@@ -14,29 +12,23 @@ Fixes | |||
14 | 1663 | ret[retlen++] = ','; | 12 | 1663 | ret[retlen++] = ','; |
15 | | ~~~~~~~~~~~~~~^~~~~ | 13 | | ~~~~~~~~~~~~~~^~~~~ |
16 | 14 | ||
17 | Upstream-Status: Pending | 15 | Upstream-Status: Submitted [email discussion with upstream] |
16 | |||
17 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> | ||
18 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 18 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
19 | --- | ||
20 | map.c | 6 ++++-- | ||
21 | 1 file changed, 4 insertions(+), 2 deletions(-) | ||
22 | 19 | ||
23 | diff --git a/map.c b/map.c | 20 | Index: git/map.c |
24 | index 412305c..fa0c493 100644 | 21 | =================================================================== |
25 | --- a/map.c | 22 | --- git.orig/map.c |
26 | +++ b/map.c | 23 | +++ git/map.c |
27 | @@ -1659,8 +1659,10 @@ static char *new_game_desc(const game_params *params, random_state *rs, | 24 | @@ -1659,6 +1659,10 @@ static char *new_game_desc(const game_pa |
28 | } | 25 | } |
29 | } | 26 | } |
30 | 27 | ||
31 | - ret[retlen++] = 'a'-1 + run; | 28 | + if (retlen + 10 >= retsize) { |
32 | - ret[retlen++] = ','; | 29 | + retsize = retlen + 256; |
33 | + if(ret != NULL) { | 30 | + ret = sresize(ret, retsize, char); |
34 | + ret[retlen++] = 'a'-1 + run; | 31 | + } |
35 | + ret[retlen++] = ','; | 32 | ret[retlen++] = 'a'-1 + run; |
36 | + } | 33 | ret[retlen++] = ','; |
37 | 34 | ||
38 | run = 0; | ||
39 | for (i = 0; i < n; i++) { | ||
40 | -- | ||
41 | 2.30.1 | ||
42 | |||
diff --git a/meta/recipes-sato/puzzles/files/0001-palisade-Fix-warnings-with-clang-on-arm.patch b/meta/recipes-sato/puzzles/files/0001-palisade-Fix-warnings-with-clang-on-arm.patch index 143e898a51..07eb1d32f6 100644 --- a/meta/recipes-sato/puzzles/files/0001-palisade-Fix-warnings-with-clang-on-arm.patch +++ b/meta/recipes-sato/puzzles/files/0001-palisade-Fix-warnings-with-clang-on-arm.patch | |||
@@ -1,7 +1,6 @@ | |||
1 | From 453587d714473b806473b309727f865b673cbc06 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | 1 | From: Khem Raj <raj.khem@gmail.com> |
3 | Date: Wed, 13 Jan 2016 23:10:19 -0800 | 2 | |
4 | Subject: [PATCH] palisade: Fix warnings with clang on arm | 3 | palisade: Fix warnings with clang on arm |
5 | 4 | ||
6 | ARM treats 'char' as unsigned char when 'char' is not qualified with | 5 | ARM treats 'char' as unsigned char when 'char' is not qualified with |
7 | 'signed' or 'unsigned' explicitly. | 6 | 'signed' or 'unsigned' explicitly. |
@@ -15,54 +14,59 @@ type 'clue' (aka 'char') is always false | |||
15 | 14 | ||
16 | Therefore, typcast the contant to char in such places to be explicit | 15 | Therefore, typcast the contant to char in such places to be explicit |
17 | 16 | ||
17 | Upstream-Status: Submitted [email discussion with upstream] | ||
18 | |||
19 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> | ||
18 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 20 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
19 | Upstream-Status: Submitted | ||
20 | --- | ||
21 | palisade.c | 10 +++++----- | ||
22 | 1 file changed, 5 insertions(+), 5 deletions(-) | ||
23 | 21 | ||
24 | diff --git a/palisade.c b/palisade.c | 22 | Index: git/palisade.c |
25 | index 6ffbf2d..8b54d42 100644 | 23 | =================================================================== |
26 | --- a/palisade.c | 24 | --- git.orig/palisade.c |
27 | +++ b/palisade.c | 25 | +++ git/palisade.c |
28 | @@ -304,11 +304,11 @@ static void solver_connected_clues_versus_region_size(solver_ctx *ctx) | 26 | @@ -46,7 +46,7 @@ struct game_params { |
29 | * If p = q = 3 then the region has size exactly 2. */ | 27 | int w, h, k; |
28 | }; | ||
30 | 29 | ||
31 | for (i = 0; i < wh; ++i) { | 30 | -typedef char clue; |
32 | - if (ctx->clues[i] == EMPTY) continue; | 31 | +typedef signed char clue; |
33 | + if (ctx->clues[i] == (char)EMPTY) continue; | 32 | typedef unsigned char borderflag; |
34 | for (dir = 0; dir < 4; ++dir) { | ||
35 | int j = i + dx[dir] + w*dy[dir]; | ||
36 | if (disconnected(ctx, i, j, dir)) continue; | ||
37 | - if (ctx->clues[j] == EMPTY) continue; | ||
38 | + if (ctx->clues[j] == (char)EMPTY) continue; | ||
39 | if ((8 - ctx->clues[i] - ctx->clues[j] > ctx->params->k) || | ||
40 | (ctx->clues[i] == 3 && ctx->clues[j] == 3 && | ||
41 | ctx->params->k != 2)) | ||
42 | @@ -326,7 +326,7 @@ static bool solver_number_exhausted(solver_ctx *ctx) | ||
43 | bool changed = false; | ||
44 | 33 | ||
45 | for (i = 0; i < wh; ++i) { | 34 | typedef struct shared_state { |
46 | - if (ctx->clues[i] == EMPTY) continue; | 35 | @@ -242,7 +242,7 @@ typedef struct solver_ctx { |
47 | + if (ctx->clues[i] == (char)EMPTY) continue; | 36 | * thing is done. See how it is propagated across multiple squares.] |
37 | */ | ||
48 | 38 | ||
49 | if (bitcount[(ctx->borders[i] & BORDER_MASK)] == ctx->clues[i]) { | 39 | -#define EMPTY (~0) |
50 | for (dir = 0; dir < 4; ++dir) { | 40 | +#define EMPTY ((clue)-1) |
51 | @@ -538,7 +538,7 @@ static bool is_solved(const game_params *params, clue *clues, | ||
52 | for (i = 0; i < wh; ++i) { | ||
53 | if (dsf[i] == UNVISITED) dfs_dsf(i, params->w, border, dsf, true); | ||
54 | if (dsf_size(dsf, i) != k) goto error; | ||
55 | - if (clues[i] == EMPTY) continue; | ||
56 | + if (clues[i] == (char)EMPTY) continue; | ||
57 | if (clues[i] != bitcount[border[i] & BORDER_MASK]) goto error; | ||
58 | } | ||
59 | 41 | ||
60 | @@ -685,7 +685,7 @@ static char *new_game_desc(const game_params *params, random_state *rs, | 42 | #define BIT(i) (1 << (i)) |
61 | p = numbers; | 43 | #define BORDER(i) BIT(i) |
44 | @@ -622,7 +622,7 @@ static char *new_game_desc(const game_pa | ||
45 | { | ||
46 | int w = params->w, h = params->h, wh = w*h, k = params->k; | ||
47 | |||
48 | - clue *numbers = snewn(wh + 1, clue), *p; | ||
49 | + clue *numbers = snewn(wh + 1, clue); | ||
50 | borderflag *rim = snewn(wh, borderflag); | ||
51 | borderflag *scratch_borders = snewn(wh, borderflag); | ||
52 | |||
53 | @@ -682,7 +682,8 @@ static char *new_game_desc(const game_pa | ||
54 | sfree(shuf); | ||
55 | sfree(dsf); | ||
56 | |||
57 | - p = numbers; | ||
58 | + char *output = snewn(wh + 1, char), *p = output; | ||
59 | + | ||
62 | r = 0; | 60 | r = 0; |
63 | for (i = 0; i < wh; ++i) { | 61 | for (i = 0; i < wh; ++i) { |
64 | - if (numbers[i] != EMPTY) { | 62 | if (numbers[i] != EMPTY) { |
65 | + if (numbers[i] != (char)EMPTY) { | 63 | @@ -699,7 +700,8 @@ static char *new_game_desc(const game_pa |
66 | while (r) { | 64 | } |
67 | while (r > 26) { | 65 | *p++ = '\0'; |
68 | *p++ = 'z'; | 66 | |
67 | - return sresize(numbers, p - numbers, clue); | ||
68 | + sfree(numbers); | ||
69 | + return sresize(output, p - output, char); | ||
70 | } | ||
71 | |||
72 | static const char *validate_desc(const game_params *params, const char *desc) | ||
diff --git a/meta/recipes-sato/puzzles/files/0001-pattern.c-Change-string-lenght-parameter-to-be-size_.patch b/meta/recipes-sato/puzzles/files/0001-pattern.c-Change-string-lenght-parameter-to-be-size_.patch index 7ca582fe5d..5e240bfea5 100644 --- a/meta/recipes-sato/puzzles/files/0001-pattern.c-Change-string-lenght-parameter-to-be-size_.patch +++ b/meta/recipes-sato/puzzles/files/0001-pattern.c-Change-string-lenght-parameter-to-be-size_.patch | |||
@@ -1,26 +1,25 @@ | |||
1 | From 3af5a1e579e3324a13ba1f892c7befb3ab32d899 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | 1 | From: Khem Raj <raj.khem@gmail.com> |
3 | Date: Thu, 7 Mar 2019 21:56:57 -0800 | 2 | |
4 | Subject: [PATCH] pattern.c: Change string lenght parameter to be size_t in | 3 | pattern.c: Change string lenght parameter to be size_t in do_row() |
5 | do_row() | ||
6 | 4 | ||
7 | This fixes below error on some architectures e.g. RISC-V | 5 | This fixes below error on some architectures e.g. RISC-V |
8 | 6 | ||
9 | pattern.c:455:9: error: 'memset' specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=] 455 | memset(deduced, DOT, (size_t)len); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 7 | pattern.c:455:9: error: 'memset' specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=] 455 | memset(deduced, DOT, (size_t)len); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
10 | 8 | ||
11 | Upstream-Status: Pending | 9 | Upstream-Status: Submitted [email discussion with upstream] |
12 | 10 | ||
11 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> | ||
13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
14 | 13 | ||
15 | --- | 14 | --- |
16 | pattern.c | 2 +- | 15 | pattern.c | 2 +- |
17 | 1 file changed, 1 insertion(+), 1 deletion(-) | 16 | 1 file changed, 1 insertion(+), 1 deletion(-) |
18 | 17 | ||
19 | diff --git a/pattern.c b/pattern.c | 18 | Index: git/pattern.c |
20 | index ffadd3f..4e5f187 100644 | 19 | =================================================================== |
21 | --- a/pattern.c | 20 | --- git.orig/pattern.c |
22 | +++ b/pattern.c | 21 | +++ git/pattern.c |
23 | @@ -428,7 +428,7 @@ static bool do_row(unsigned char *known, unsigned char *deduced, | 22 | @@ -429,7 +429,7 @@ static bool do_row(unsigned char *known, |
24 | unsigned char *row, | 23 | unsigned char *row, |
25 | unsigned char *minpos_done, unsigned char *maxpos_done, | 24 | unsigned char *minpos_done, unsigned char *maxpos_done, |
26 | unsigned char *minpos_ok, unsigned char *maxpos_ok, | 25 | unsigned char *minpos_ok, unsigned char *maxpos_ok, |
@@ -29,6 +28,3 @@ index ffadd3f..4e5f187 100644 | |||
29 | unsigned int *changed | 28 | unsigned int *changed |
30 | #ifdef STANDALONE_SOLVER | 29 | #ifdef STANDALONE_SOLVER |
31 | , const char *rowcol, int index, int cluewid | 30 | , const char *rowcol, int index, int cluewid |
32 | -- | ||
33 | 2.17.1 | ||
34 | |||
diff --git a/meta/recipes-sato/puzzles/files/fix-compiling-failure-with-option-g-O.patch b/meta/recipes-sato/puzzles/files/fix-compiling-failure-with-option-g-O.patch index 28040523d4..4ee7543166 100644 --- a/meta/recipes-sato/puzzles/files/fix-compiling-failure-with-option-g-O.patch +++ b/meta/recipes-sato/puzzles/files/fix-compiling-failure-with-option-g-O.patch | |||
@@ -1,17 +1,9 @@ | |||
1 | From 876c6ff1e20f51b0921acda99861f476b6423f26 Mon Sep 17 00:00:00 2001 | ||
2 | From: Hongxu Jia <hongxu.jia@windriver.com> | 1 | From: Hongxu Jia <hongxu.jia@windriver.com> |
3 | Date: Mon, 11 Aug 2014 12:39:53 +0800 | ||
4 | Subject: [PATCH] gtk.c: fix compiling failure with option -g -O | ||
5 | 2 | ||
6 | There were compiling failure with option -g -O | 3 | gtk.c: fix compiling failure with option -g -O |
4 | |||
5 | There was a compile failure with option -g -O | ||
7 | ... | 6 | ... |
8 | ././gtk.c: In function 'configure_area': | ||
9 | ././gtk.c:397:2: error: 'cr' may be used uninitialized in this function [-Werror=maybe-uninitialized] | ||
10 | cairo_set_source_rgb(cr, | ||
11 | ^ | ||
12 | ././gtk.c:384:14: note: 'cr' was declared here | ||
13 | cairo_t *cr; | ||
14 | ^ | ||
15 | ././gtk.c: In function 'main': | 7 | ././gtk.c: In function 'main': |
16 | ././gtk.c:2911:6: error: 'error' may be used uninitialized in this function [-Werror=maybe-uninitialized] | 8 | ././gtk.c:2911:6: error: 'error' may be used uninitialized in this function [-Werror=maybe-uninitialized] |
17 | fprintf(stderr, "%s: %s\n", pname, error); | 9 | fprintf(stderr, "%s: %s\n", pname, error); |
@@ -19,21 +11,18 @@ There were compiling failure with option -g -O | |||
19 | cc1: all warnings being treated as errors | 11 | cc1: all warnings being treated as errors |
20 | ... | 12 | ... |
21 | 13 | ||
22 | Initialized pointer 'cr' and 'error' with NULL | 14 | Fix by initializing pointer 'error' with NULL |
23 | 15 | ||
24 | Upstream-Status: Pending | 16 | Upstream-Status: Submitted [email discussion with upstream] |
25 | 17 | ||
18 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> | ||
26 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | 19 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> |
27 | 20 | ||
28 | --- | 21 | Index: git/gtk.c |
29 | gtk.c | 2 +- | 22 | =================================================================== |
30 | 1 file changed, 1 insertion(+), 1 deletion(-) | 23 | --- git.orig/gtk.c |
31 | 24 | +++ git/gtk.c | |
32 | diff --git a/gtk.c b/gtk.c | 25 | @@ -3578,7 +3578,7 @@ static void list_presets_from_menu(struc |
33 | index 4565836..5e83b48 100644 | ||
34 | --- a/gtk.c | ||
35 | +++ b/gtk.c | ||
36 | @@ -2944,7 +2944,7 @@ static void list_presets_from_menu(struct preset_menu *menu) | ||
37 | int main(int argc, char **argv) | 26 | int main(int argc, char **argv) |
38 | { | 27 | { |
39 | char *pname = argv[0]; | 28 | char *pname = argv[0]; |
diff --git a/meta/recipes-sato/puzzles/files/fix-ki-uninitialized.patch b/meta/recipes-sato/puzzles/files/fix-ki-uninitialized.patch index 7218d620ec..b182240240 100644 --- a/meta/recipes-sato/puzzles/files/fix-ki-uninitialized.patch +++ b/meta/recipes-sato/puzzles/files/fix-ki-uninitialized.patch | |||
@@ -1,25 +1,32 @@ | |||
1 | puzzles: avoid compiler unitialized variable error | 1 | tree123: avoid compiler unitialized variable error |
2 | 2 | ||
3 | The compiler does not realize that we must go through the while() | 3 | The compiler does not realize that we must go through the while() |
4 | loop at least once, so we replace it with a for() loop. | 4 | loop at least once, so we replace it with a for() loop. |
5 | 5 | ||
6 | Upstream-Status: Pending | 6 | Upstream-Status: Submitted [email discussion with upstream] |
7 | 7 | ||
8 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> | ||
8 | Signed-off-by: Joe Slater <joe.slater@windriver.com> | 9 | Signed-off-by: Joe Slater <joe.slater@windriver.com> |
9 | 10 | ||
10 | --- a/tree234.c | 11 | Index: git/tree234.c |
11 | +++ b/tree234.c | 12 | =================================================================== |
12 | @@ -326,8 +326,11 @@ static void *add234_internal(tree234 *t, | 13 | --- git.orig/tree234.c |
13 | return orig_e; | 14 | +++ git/tree234.c |
15 | @@ -335,7 +335,7 @@ static void *add234_internal(tree234 *t, | ||
14 | } | 16 | } |
15 | 17 | ||
16 | - n = t->root; | 18 | n = t->root; |
17 | - while (n) { | 19 | - while (n) { |
18 | + /* | 20 | + do { |
19 | + * We know t->root is not NULL. The logic | ||
20 | + * to break out of this is at the end of the loop. | ||
21 | + */ | ||
22 | + for (n = t->root;;) { | ||
23 | LOG((" node %p: %p/%d \"%s\" %p/%d \"%s\" %p/%d \"%s\" %p/%d\n", | 21 | LOG((" node %p: %p/%d \"%s\" %p/%d \"%s\" %p/%d \"%s\" %p/%d\n", |
24 | n, | 22 | n, |
25 | n->kids[0], n->counts[0], n->elems[0], | 23 | n->kids[0], n->counts[0], n->elems[0], |
24 | @@ -388,7 +388,7 @@ static void *add234_internal(tree234 *t, | ||
25 | if (!n->kids[ki]) | ||
26 | break; | ||
27 | n = n->kids[ki]; | ||
28 | - } | ||
29 | + } while (n); | ||
30 | |||
31 | add234_insert(NULL, e, NULL, &t->root, n, ki); | ||
32 | |||