Skip to content

Commit

Permalink
Add missing reverse deps for some sockets code (#9158)
Browse files Browse the repository at this point in the history
Fixes #9154
  • Loading branch information
kripken committed Aug 9, 2019
1 parent 095b841 commit 9c317db
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/deps_info.json
Expand Up @@ -29,9 +29,11 @@
"freelocale": ["free"],
"nl_langinfo": ["malloc"],
"inet_ntoa": ["malloc"],
"gethostbyname": ["malloc", "free", "htons"],
"gethostbyname_r": ["malloc", "free", "htons"],
"gethostbyname": ["malloc", "free", "htons", "ntohs"],
"gethostbyname_r": ["malloc", "free", "htons", "ntohs"],
"getaddrinfo": ["malloc", "htonl", "htons", "ntohs"],
"getnameinfo": ["htons", "ntohs"],
"getpeername": ["htons", "ntohs"],
"_inet_ntop6_raw": ["ntohs"],
"_read_sockaddr": ["ntohs"],
"freeaddrinfo": ["free"],
Expand Down
4 changes: 2 additions & 2 deletions src/library.js
Expand Up @@ -3413,7 +3413,7 @@ LibraryManager.library = {
_inet_ntop4_raw: function(addr) {
return (addr & 0xff) + '.' + ((addr >> 8) & 0xff) + '.' + ((addr >> 16) & 0xff) + '.' + ((addr >> 24) & 0xff)
},
_inet_pton6_raw__deps: ['htons'],
_inet_pton6_raw__deps: ['htons', 'ntohs'],
_inet_pton6_raw: function(str) {
var words;
var w, offset, z, i;
Expand Down Expand Up @@ -3578,7 +3578,7 @@ LibraryManager.library = {
return str;
},

_read_sockaddr__deps: ['$Sockets', '_inet_ntop4_raw', '_inet_ntop6_raw'],
_read_sockaddr__deps: ['$Sockets', '_inet_ntop4_raw', '_inet_ntop6_raw', 'ntohs'],
_read_sockaddr: function (sa, salen) {
// family / port offsets are common to both sockaddr_in and sockaddr_in6
var family = {{{ makeGetValue('sa', C_STRUCTS.sockaddr_in.sin_family, 'i16') }}};
Expand Down
2 changes: 1 addition & 1 deletion tests/test_other.py
Expand Up @@ -8100,7 +8100,7 @@ def test_binaryen_metadce_hello(self, *args):
0, [], [], 8, 0, 0, 0), # noqa; totally empty!
# we don't metadce with linkable code! other modules may want stuff
# don't compare the # of functions in a main module, which changes a lot
'main_module_1': (['-O3', '-s', 'MAIN_MODULE=1'], 1576, [], [], 226403, None, 96, None), # noqa
'main_module_1': (['-O3', '-s', 'MAIN_MODULE=1'], 1576, [], [], 226403, None, 97, None), # noqa
'main_module_2': (['-O3', '-s', 'MAIN_MODULE=2'], 15, [], [], 10571, 19, 9, 21), # noqa
})
@no_wasm_backend()
Expand Down

0 comments on commit 9c317db

Please sign in to comment.