We've been passing `ARRAY_SIZE()` (equal to 16 in this case) as a radix to _itow(). This has caused us trying to get "a" instead of "10", etc. which resulted in unexpected nulls being interspersed in long arrays as well as the arrays being cut short.
From: Arkadiusz Hiler ahiler@codeweavers.com
We've been passing `ARRAY_SIZE()` (equal to 16 in this case) as a radix to _itow(). This has caused us trying to get "a" instead of "10", etc. which resulted in unexpected nulls being interspersed in long arrays as well as the arrays being cut short. --- dlls/jscript/json.c | 2 +- dlls/jscript/tests/api.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/jscript/json.c b/dlls/jscript/json.c index 9018687aba2..093bd5bf386 100644 --- a/dlls/jscript/json.c +++ b/dlls/jscript/json.c @@ -707,7 +707,7 @@ static HRESULT stringify_array(stringify_ctx_t *ctx, jsdisp_t *obj) } }
- _itow(i, name, ARRAY_SIZE(name)); + _itow_s(i, name, ARRAY_SIZE(name), 10); hres = stringify(ctx, obj, name); if(FAILED(hres)) return hres; diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js index 255418a6744..aea7cac63dc 100644 --- a/dlls/jscript/tests/api.js +++ b/dlls/jscript/tests/api.js @@ -1965,7 +1965,8 @@ ok(isNaN(tmp), "Math.tan(-Infinity) is not NaN"); "{\n "prop1": true,\n "prop2": {\n "prop": "string"\n }\n}"], [[{ },undefined," "], "{}"], [[[,2,undefined,3,{ },]],"[null,2,null,3,{},null]"], - [[[,2,undefined,3,{prop:0},],undefined," "],"[\n null,\n 2,\n null,\n 3,\n {\n "prop": 0\n },\n null\n]"] + [[[,2,undefined,3,{prop:0},],undefined," "],"[\n null,\n 2,\n null,\n 3,\n {\n "prop": 0\n },\n null\n]"], + [[[0,0,0,0,0,0,0,0,0,0,0,0]], "[0,0,0,0,0,0,0,0,0,0,0,0]"] ];
var i, s, v, t;
Looks like 32bit CI is consistently failing on those 4 tests recently.
This merge request was approved by Jacek Caban.