Skip to content

Commit 21ac3e0

Browse files
authored
Fix 'maybe unitialized' error (#19)
Building with recent compilers flags the following error: ``` Sming/Libraries/jerryscript/jerryscript/jerry-core/ecma/base/ecma-helpers-string.c:1848:6: error: ‘string1_size_and_length[0]’ may be used uninitialized [-Werror=maybe-uninitialized] 1848 | if (string1_size_and_length[0] != string2_size_and_length[0] ````
1 parent c8f2489 commit 21ac3e0

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

jerryscript.patch

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,3 +207,16 @@ index 36c02277..94d0934f 100644
207207
switch (code)
208208
{
209209
case ERR_OUT_OF_MEMORY:
210+
diff --git a/jerry-core/ecma/base/ecma-helpers-string.c b/jerry-core/ecma/base/ecma-helpers-string.c
211+
index 12770f36..5ab67df2 100644
212+
--- a/jerry-core/ecma/base/ecma-helpers-string.c
213+
+++ b/jerry-core/ecma/base/ecma-helpers-string.c
214+
@@ -1835,7 +1835,7 @@ ecma_compare_ecma_strings_longpath (const ecma_string_t *string1_p, /**< ecma-st
215+
const ecma_string_t *string2_p) /**< ecma-string */
216+
{
217+
const lit_utf8_byte_t *utf8_string1_p, *utf8_string2_p;
218+
- lit_utf8_size_t string1_size_and_length[2], string2_size_and_length[2];
219+
+ lit_utf8_size_t string1_size_and_length[2]={0}, string2_size_and_length[2]={0};
220+
221+
utf8_string1_p = ecma_compare_get_string_chars (string1_p, string1_size_and_length);
222+
utf8_string2_p = ecma_compare_get_string_chars (string2_p, string2_size_and_length);

0 commit comments

Comments
 (0)