@@ -602,23 +602,20 @@ function makeBigInt(low, high, unsigned) {
602
602
603
603
/** @param {Array= } args */
604
604
function dynCall ( sig , ptr , args ) {
605
- #if ASSERTIONS
606
- if ( args && args . length ) {
607
- // j (64-bit integer) must be passed in as two numbers [low 32, high 32].
608
- assert ( args . length === sig . substring ( 1 ) . replace ( / j / g, '--' ) . length ) ;
609
- } else {
610
- assert ( sig . length == 1 ) ;
611
- }
612
- #endif
613
-
614
605
#if ! WASM_BIGINT
606
+ // Without WASM_BIGINT support we cannot directly call function with i64 as
607
+ // part of thier signature, so we rely the dynCall functions generated by
608
+ // wasm-emscripten-finalize
615
609
if ( sig . indexOf ( 'j' ) != - 1 ) {
616
610
#if ASSERTIONS
617
- assert ( ( 'dynCall_' + sig ) in Module , 'bad function pointer type - no table for sig \'' + sig + '\'' ) ;
611
+ assert ( ( 'dynCall_' + sig ) in Module , 'bad function pointer type - no table for sig \'' + sig + '\'' ) ;
618
612
#endif
619
613
if ( args && args . length ) {
614
+ // j (64-bit integer) must be passed in as two numbers [low 32, high 32].
615
+ assert ( args . length === sig . substring ( 1 ) . replace ( / j / g, '--' ) . length ) ;
620
616
return Module [ 'dynCall_' + sig ] . apply ( null , [ ptr ] . concat ( args ) ) ;
621
617
} else {
618
+ assert ( sig . length == 1 ) ;
622
619
return Module [ 'dynCall_' + sig ] . call ( null , ptr ) ;
623
620
}
624
621
}
0 commit comments