Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions system/include/emscripten/bind.h
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,13 @@ struct SignatureCode<size_t> {
}
};

template<>
struct SignatureCode<long long> {
static constexpr char get() {
return 'j';
}
};

#ifdef __wasm64__
template<>
struct SignatureCode<long> {
Expand All @@ -629,6 +636,8 @@ template<> struct SignatureTranslator<double> { using type = double; };
#ifdef __wasm64__
template<> struct SignatureTranslator<long> { using type = long; };
#endif
template<> struct SignatureTranslator<long long> { using type = long long; };
template<> struct SignatureTranslator<unsigned long long> { using type = long long; };
template<> struct SignatureTranslator<size_t> { using type = size_t; };
template<typename PtrType>
struct SignatureTranslator<PtrType*> { using type = void*; };
Expand Down
8 changes: 8 additions & 0 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -3296,6 +3296,14 @@ def test_embind_return_value_policy(self):

self.do_runf('embind/test_return_value_policy.cpp')

@parameterized({
'': [[]],
'asyncify': [['-sASYNCIFY=1']]
})
def test_embind_bigint(self, args):
self.do_runf('embind/test_bigint.cpp', '1000000000000n\n-1000000000000n',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this new file missing from this PR?

Can you call it test_embind_bigint to match the test name?

Should it be called test_embind_int64 perhaps? Or test_embind_long_long?

emcc_args=['-lembind', '-sWASM_BIGINT'] + args)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow I guess we just never had anyone try this before?

Why does this require -sWASM_BIGINT to expose the issue? It looks like that lack of a long long mapping is a problem regardless of this setting?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems only ASYNCIFY exposed this because it uses the signature to create a DYNCALL with the legacy mode. Without asyncify bigints were working fine.


@requires_jspi
@parameterized({
'': [['-sJSPI_EXPORTS=async*']],
Expand Down
Loading