Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
bugfix: empty_array can not work on Apple because csjon did not compa…
Browse files Browse the repository at this point in the history
…re light userdata address with masked address (mpx#82)

Since we used `json_lightudata_mask` when creating lightuserdata, same
mask should be applied when comparing the return of `touserdata`

Fixes mpx#81.
  • Loading branch information
dndx authored Jan 13, 2022
1 parent 0f3dda3 commit 92cebdc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua_cjson.c
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ static void json_append_data(lua_State *l, json_config_t *cfg,
case LUA_TLIGHTUSERDATA:
if (lua_touserdata(l, -1) == NULL) {
strbuf_append_mem(json, "null", 4);
} else if (lua_touserdata(l, -1) == &json_array) {
} else if (lua_touserdata(l, -1) == json_lightudata_mask(&json_array)) {
json_append_array(l, cfg, current_depth, json, 0);
}
break;
Expand Down

0 comments on commit 92cebdc

Please sign in to comment.