@@ -602,23 +602,20 @@ function makeBigInt(low, high, unsigned) {
602602
603603/** @param {Array= } args */
604604function 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-
614605#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
615609 if ( sig . indexOf ( 'j' ) != - 1 ) {
616610#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 + '\'' ) ;
618612#endif
619613 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 ) ;
620616 return Module [ 'dynCall_' + sig ] . apply ( null , [ ptr ] . concat ( args ) ) ;
621617 } else {
618+ assert ( sig . length == 1 ) ;
622619 return Module [ 'dynCall_' + sig ] . call ( null , ptr ) ;
623620 }
624621 }
0 commit comments