File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,12 +33,13 @@ bool IsJSCompatibleSignature(const FunctionSig* sig) {
3333 // Rtts are internal-only. They should never be part of a signature.
3434 DCHECK (!type.is_rtt ());
3535 if (type == kWasmS128 ) return false ;
36- if (type == kWasmExnRef ) return false ;
3736 if (type.is_object_reference ()) {
3837 switch (type.heap_representation_non_shared ()) {
3938 case HeapType::kStringViewWtf8 :
4039 case HeapType::kStringViewWtf16 :
4140 case HeapType::kStringViewIter :
41+ case HeapType::kExn :
42+ case HeapType::kNoExn :
4243 return false ;
4344 default :
4445 break ;
Original file line number Diff line number Diff line change @@ -653,3 +653,21 @@ d8.file.execute("test/mjsunit/wasm/exceptions-utils.js");
653653
654654 assertTraps ( kTrapRethrowNull , ( ) => instance . exports . throw_noexn ( ) ) ;
655655} ) ( ) ;
656+
657+ ( function TestJSNonNullableExnRef ( ) {
658+ print ( arguments . callee . name ) ;
659+ let builder = new WasmModuleBuilder ( ) ;
660+ let import_sig = makeSig ( [ ] , [ wasmRefType ( kWasmExnRef ) ] ) ;
661+ let imported = builder . addImport ( 'm' , 'i' , import_sig ) ;
662+ builder . addFunction ( "call_import" , kSig_v_v )
663+ . addBody ( [
664+ kExprCallFunction , imported ,
665+ kExprDrop ,
666+ ] ) . exportFunc ( ) ;
667+ let export_sig = makeSig ( [ wasmRefType ( kWasmExnRef ) ] , [ ] ) ;
668+ builder . addFunction ( "export" , export_sig )
669+ . addBody ( [ ] ) . exportFunc ( ) ;
670+ let instance = builder . instantiate ( { m : { i : ( ) => { } } } ) ;
671+ assertThrows ( instance . exports . call_import ) ;
672+ assertThrows ( instance . exports . export ) ;
673+ } ) ( ) ;
You can’t perform that action at this time.
0 commit comments